Changed fuzzy matching to favour matching case
This commit is contained in:
+2
-2
@@ -363,11 +363,11 @@ static int f_fuzzy_match(lua_State *L) {
|
||||
while (*str == ' ') { str++; }
|
||||
while (*ptn == ' ') { ptn++; }
|
||||
if (tolower(*str) == tolower(*ptn)) {
|
||||
score += run;
|
||||
score += run * 10 - (*str != *ptn);
|
||||
run++;
|
||||
ptn++;
|
||||
} else {
|
||||
score--;
|
||||
score -= 10;
|
||||
run = 0;
|
||||
}
|
||||
str++;
|
||||
|
||||
Reference in New Issue
Block a user