Severity Code Description Project File Line Suppression State

Warning CA1307 The behavior of 'string.IndexOf(string)' could vary based on the current user's locale settings. Replace this call in 'PowerLauncher.MainWindow.ListView_FirstItem(string)' with a call to 'string.IndexOf(string, System.StringComparison)'. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs 269 Active
This commit is contained in:
ryanbodrug-microsoft 2020-06-18 09:06:55 -07:00
parent 849ce04def
commit 6890561723

View file

@ -277,7 +277,7 @@ namespace PowerLauncher
int selectedIndex = _viewModel.Results.SelectedIndex;
if (selectedItem != null && selectedIndex == 0)
{
if (selectedItem.IndexOf(input) == 0)
if (selectedItem.IndexOf(input, StringComparison.InvariantCultureIgnoreCase) == 0)
{
return selectedItem;
}