merge one extra condition to the switch case

This commit is contained in:
弘韬 张 2020-10-18 21:24:59 +08:00 committed by 张弘韬
parent ab9e6a8143
commit b07490271d

View file

@ -76,10 +76,16 @@ namespace Flow.Launcher.Infrastructure
if (currentQueryIndex >= queryWithoutCase.Length)
break;
if (compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex]))
{
acronymMatchData.Add(compareIndex);
currentQueryIndex++;
continue;
}
switch (stringToCompare[compareIndex])
{
case char c when (compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex]))
case char c when compareIndex == 0 && queryWithoutCase[currentQueryIndex] == char.ToLower(stringToCompare[compareIndex])
|| (char.IsUpper(c) && char.ToLower(c) == queryWithoutCase[currentQueryIndex])
|| (char.IsWhiteSpace(c) && char.ToLower(stringToCompare[++compareIndex]) == queryWithoutCase[currentQueryIndex]):
acronymMatchData.Add(compareIndex);