logic: Fixed search autocompletion scoring to not give last letter bonus
This commit is contained in:
@@ -417,15 +417,13 @@ int SearchIndex::scoreText(const std::string& text, const std::vector<size_t>& i
|
||||
else if (isupper(text[index]))
|
||||
{
|
||||
bool prevIsLower = (index > 0 && islower(text[index - 1]));
|
||||
bool nextIsLower = (index + 1 == text.size() || islower(text[index + 1]));
|
||||
bool nextIsLower = (index + 1 < text.size() && islower(text[index + 1]));
|
||||
|
||||
if (prevIsLower || nextIsLower)
|
||||
{
|
||||
camelCaseScore += camelCaseBonus;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int leadingStartScore = std::max(int(indices[0]) * delayedStartBonus, minDelayedStartBonus);
|
||||
|
||||
Reference in New Issue
Block a user