Skip to content

Commit b074902

Browse files
committed
merge one extra condition to the switch case
1 parent ab9e6a8 commit b074902

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Flow.Launcher.Infrastructure/StringMatcher.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,16 @@ public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption
7676
if (currentQueryIndex >= queryWithoutCase.Length)
7777
break;
7878

79+
if (compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex]))
80+
{
81+
acronymMatchData.Add(compareIndex);
82+
currentQueryIndex++;
83+
continue;
84+
}
7985

8086
switch (stringToCompare[compareIndex])
8187
{
82-
case char c when (compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex]))
88+
case char c when compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex])
8389
|| (char.IsUpper(c) && char.ToLower(c) == queryWithoutCase[currentQueryIndex])
8490
|| (char.IsWhiteSpace(c) && char.ToLower(stringToCompare[++compareIndex]) == queryWithoutCase[currentQueryIndex]):
8591
acronymMatchData.Add(compareIndex);

0 commit comments

Comments
 (0)