Skip to content

Commit 2a423f0

Browse files
committed
Improve code quality
1 parent 3cb9d1d commit 2a423f0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Flow.Launcher.Infrastructure/StringMatcher.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ namespace Flow.Launcher.Infrastructure
88
{
99
public class StringMatcher
1010
{
11-
private readonly MatchOption _defaultMatchOption = new MatchOption();
11+
private readonly MatchOption _defaultMatchOption = new();
1212

1313
public SearchPrecisionScore UserSettingSearchPrecision { get; set; }
1414

1515
private readonly IAlphabet _alphabet;
1616

17-
public StringMatcher(IAlphabet alphabet = null)
17+
public StringMatcher()
1818
{
1919
_alphabet = Ioc.Default.GetRequiredService<IAlphabet>();
2020
}
@@ -242,16 +242,16 @@ private bool IsAcronymCount(string stringToCompare, int compareStringIndex)
242242
return false;
243243
}
244244

245-
private bool IsAcronymChar(string stringToCompare, int compareStringIndex)
245+
private static bool IsAcronymChar(string stringToCompare, int compareStringIndex)
246246
=> char.IsUpper(stringToCompare[compareStringIndex]) ||
247247
compareStringIndex == 0 || // 0 index means char is the start of the compare string, which is an acronym
248248
char.IsWhiteSpace(stringToCompare[compareStringIndex - 1]);
249249

250-
private bool IsAcronymNumber(string stringToCompare, int compareStringIndex)
250+
private static bool IsAcronymNumber(string stringToCompare, int compareStringIndex)
251251
=> stringToCompare[compareStringIndex] >= 0 && stringToCompare[compareStringIndex] <= 9;
252252

253253
// To get the index of the closest space which preceeds the first matching index
254-
private int CalculateClosestSpaceIndex(List<int> spaceIndices, int firstMatchIndex)
254+
private static int CalculateClosestSpaceIndex(List<int> spaceIndices, int firstMatchIndex)
255255
{
256256
var closestSpaceIndex = -1;
257257

0 commit comments

Comments
 (0)