From 65a6548c56a23c043bb95afb75bef58c51ad2d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Tue, 2 Feb 2021 12:42:55 +0800 Subject: [PATCH] Use int instead of decimal --- Flow.Launcher.Infrastructure/StringMatcher.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Infrastructure/StringMatcher.cs b/Flow.Launcher.Infrastructure/StringMatcher.cs index 48d89b862..6d53cc722 100644 --- a/Flow.Launcher.Infrastructure/StringMatcher.cs +++ b/Flow.Launcher.Infrastructure/StringMatcher.cs @@ -66,8 +66,8 @@ namespace Flow.Launcher.Infrastructure var currentAcronymQueryIndex = 0; var acronymMatchData = new List(); - decimal acronymsTotalCount = 0; - decimal acronymsMatched = 0; + int acronymsTotalCount = 0; + int acronymsMatched = 0; var fullStringToCompareWithoutCase = opt.IgnoreCase ? stringToCompare.ToLower() : stringToCompare; var queryWithoutCase = opt.IgnoreCase ? query.ToLower() : query; @@ -192,7 +192,7 @@ namespace Flow.Launcher.Infrastructure // return acronym match if all query char matched if (acronymsMatched > 0 && acronymsMatched == query.Length) { - int acronymScore = (int)(acronymsMatched / acronymsTotalCount * 100); + int acronymScore = acronymsMatched * 100 / acronymsTotalCount; if (acronymScore >= (int)UserSettingSearchPrecision) {