mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[Wox.Infrastructure] Enable analyzer and fix warnings (#16996)
This commit is contained in:
committed by
GitHub
parent
7365ba14d0
commit
561882c2f1
@@ -101,7 +101,9 @@ namespace Wox.Infrastructure
|
||||
{
|
||||
var fullStringToCompare = fullStringToCompareWithoutCase[compareStringIndex].ToString();
|
||||
var querySubstring = currentQuerySubstring[currentQuerySubstringCharacterIndex].ToString();
|
||||
#pragma warning disable CA1309 // Use ordinal string comparison (We are looking for a fuzzy match here)
|
||||
compareResult = string.Compare(fullStringToCompare, querySubstring, CultureInfo.CurrentCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace) != 0;
|
||||
#pragma warning restore CA1309 // Use ordinal string comparison
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -262,12 +264,13 @@ namespace Wox.Infrastructure
|
||||
}
|
||||
}
|
||||
|
||||
// Using CurrentCultureIgnoreCase since this relates to queries input by user
|
||||
#pragma warning disable CA1309 // Use ordinal string comparison (Using CurrentCultureIgnoreCase since this relates to queries input by user)
|
||||
if (string.Equals(query, stringToCompare, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
var bonusForExactMatch = 10;
|
||||
score += bonusForExactMatch;
|
||||
}
|
||||
#pragma warning restore CA1309 // Use ordinal string comparison
|
||||
|
||||
return score;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user