Skip to content

Commit e264af5

Browse files
committed
merge one extra condition to the switch case
1 parent c63c986 commit e264af5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Flow.Launcher.Infrastructure/StringMatcher.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,11 @@ 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-
}
8579

8680
switch (stringToCompare[compareIndex])
8781
{
88-
case char c when (char.IsUpper(c) && char.ToLower(c) == queryWithoutCase[currentQueryIndex])
82+
case char c when compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex])
83+
|| (char.IsUpper(c) && char.ToLower(c) == queryWithoutCase[currentQueryIndex])
8984
|| (char.IsWhiteSpace(c) && char.ToLower(stringToCompare[++compareIndex]) == queryWithoutCase[currentQueryIndex]):
9085
acronymMatchData.Add(compareIndex);
9186
currentQueryIndex++;

0 commit comments

Comments
 (0)