From 0093838a7535b92f996170e3dc090fd284b0207e Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 7 Jan 2020 07:25:13 +1100 Subject: [PATCH] fix variable state which failed to represent correctly Failed if query text is 'sql servman'- returns true when should be false - moved it up so evaluation is included in the final substring check --- Wox.Infrastructure/StringMatcher.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Wox.Infrastructure/StringMatcher.cs b/Wox.Infrastructure/StringMatcher.cs index 45fbe5808..1868eee6e 100644 --- a/Wox.Infrastructure/StringMatcher.cs +++ b/Wox.Infrastructure/StringMatcher.cs @@ -120,6 +120,9 @@ namespace Wox.Infrastructure // if finished looping through every character in the current substring if (currentQuerySubstringCharacterIndex == currentQuerySubstring.Length) { + // if any of the substrings was not matched then consider as all are not matched + allSubstringsContainedInCompareString = !matchFoundInPreviousLoop ? false : allSubstringsContainedInCompareString; + currentQuerySubstringIndex++; allQuerySubstringsMatched = AllQuerySubstringsMatched(currentQuerySubstringIndex, querySubstrings.Length); @@ -129,9 +132,6 @@ namespace Wox.Infrastructure // otherwise move to the next query substring currentQuerySubstring = querySubstrings[currentQuerySubstringIndex]; currentQuerySubstringCharacterIndex = 0; - - // if any of the substrings was not matched then consider as all are not matched - allSubstringsContainedInCompareString = !matchFoundInPreviousLoop ? false : allSubstringsContainedInCompareString; } }