Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebrody committed Feb 2, 2025
1 parent 08ea10d commit 641b4a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions react/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bitap, bitapPerformance, bitCount, Haystack, toHaystack, toNeedle, toSi
import { isHistoricalCD } from './utils/is_historical'
import { SearchIndex } from './utils/protos'

const debugSearch: boolean = true
const debugSearch: boolean = false

function debug(arg: unknown): void {
if (debugSearch) {
Expand Down Expand Up @@ -112,6 +112,7 @@ function search(searchIndex: NormalizedSearchIndex, { unnormalizedPattern, maxRe

entriesPatternChecks++
if (bitCount(patternSignature ^ (patternSignature & signature)) > maxErrors) {
// This element doesn't have the correct letters to match this pattern
entriesPatternSkips++
continue
}
Expand All @@ -128,7 +129,7 @@ function search(searchIndex: NormalizedSearchIndex, { unnormalizedPattern, maxRe
normalizedTokensWithIncompleteMatch: 0,
normalizedTokenSwapOrOverlap: 0,
}, results[results.length - 1]) > 0) {
continue entries
continue
}

let matchScore = 0
Expand Down

0 comments on commit 641b4a5

Please sign in to comment.