Skip to content

Commit 292017d

Browse files
tcl3awesomekling
authored andcommitted
AK/FuzzyMatch: Use a first letter bonus of 15 rather than 20
This matches the value used in the original `lib_fts` implementation of the algorithm.
1 parent 9fefb43 commit 292017d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AK/FuzzyMatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static constexpr int const MAX_MATCHES = 256;
1717
static constexpr int const SEQUENTIAL_BONUS = 15; // bonus for adjacent matches (needle: 'ca', haystack: 'cat')
1818
static constexpr int const SEPARATOR_BONUS = 30; // bonus if match occurs after a separator ('_' or ' ')
1919
static constexpr int const CAMEL_BONUS = 30; // bonus if match is uppercase and prev is lower (needle: 'myF' haystack: '/path/to/myFile.txt')
20-
static constexpr int const FIRST_LETTER_BONUS = 20; // bonus if the first letter is matched (needle: 'c' haystack: 'cat')
20+
static constexpr int const FIRST_LETTER_BONUS = 15; // bonus if the first letter is matched (needle: 'c' haystack: 'cat')
2121
static constexpr int const LEADING_LETTER_PENALTY = -5; // penalty applied for every letter in str before the first match
2222
static constexpr int const MAX_LEADING_LETTER_PENALTY = -15; // maximum penalty for leading letters
2323
static constexpr int const UNMATCHED_LETTER_PENALTY = -1; // penalty for every letter that doesn't matter

0 commit comments

Comments
 (0)