Skip to content

Commit 65a6548

Browse files
committed
Use int instead of decimal
1 parent f9b7294 commit 65a6548

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Flow.Launcher.Infrastructure/StringMatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption
6666
var currentAcronymQueryIndex = 0;
6767
var acronymMatchData = new List<int>();
6868

69-
decimal acronymsTotalCount = 0;
70-
decimal acronymsMatched = 0;
69+
int acronymsTotalCount = 0;
70+
int acronymsMatched = 0;
7171

7272
var fullStringToCompareWithoutCase = opt.IgnoreCase ? stringToCompare.ToLower() : stringToCompare;
7373
var queryWithoutCase = opt.IgnoreCase ? query.ToLower() : query;
@@ -192,7 +192,7 @@ public MatchResult FuzzyMatch(string query, string stringToCompare, MatchOption
192192
// return acronym match if all query char matched
193193
if (acronymsMatched > 0 && acronymsMatched == query.Length)
194194
{
195-
int acronymScore = (int)(acronymsMatched / acronymsTotalCount * 100);
195+
int acronymScore = acronymsMatched * 100 / acronymsTotalCount;
196196

197197
if (acronymScore >= (int)UserSettingSearchPrecision)
198198
{

0 commit comments

Comments
 (0)