mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
Fix for fuzzy search function
Ref T97
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c8a9f76a32
commit
3b6edcd575
@@ -89,16 +89,16 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// char after
|
// char after
|
||||||
const int a = p + 1;
|
const int after = p + 1;
|
||||||
if (a < bStr.length() && aStr[p] == bStr[a])
|
if (after < bStr.length() && aStr[p] == bStr[after])
|
||||||
{
|
{
|
||||||
points += 0.5;
|
points += 0.5;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// char before
|
// char before
|
||||||
const int b = p - 1;
|
const int before = p - 1;
|
||||||
if (b >= 0 && aStr[p] == bStr[b])
|
if (before >= 0 && before < bStr.length() && aStr[p] == bStr[before])
|
||||||
{
|
{
|
||||||
points += 0.5;
|
points += 0.5;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user