mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-09-26 22:55:42 +00:00
handle hash collision, closes #687
This commit is contained in:
@@ -102,12 +102,14 @@ async function loadStats (language: string) {
|
||||
start = indexMatcher[start * INDEX_WIDTH + 1]
|
||||
const end = ndjson.indexOf('\n', start)
|
||||
const stat = JSON.parse(ndjson.slice(start, end)) as Stat
|
||||
return {
|
||||
stat,
|
||||
matcher: stat.matchers.find(m =>
|
||||
m.string === matchStr ||
|
||||
m.advanced === matchStr)!
|
||||
|
||||
const matcher = stat.matchers.find(m =>
|
||||
m.string === matchStr || m.advanced === matchStr)
|
||||
if (!matcher) {
|
||||
// console.log('fnv1a32 collision')
|
||||
return undefined
|
||||
}
|
||||
return { stat, matcher }
|
||||
}
|
||||
|
||||
STATS_ITERATOR = ndjsonFindLines<Stat>(ndjson)
|
||||
|
||||
Reference in New Issue
Block a user