Skip to content

Commit

Permalink
Removed Path.DirectorySeparatorChar from the cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianAmbrosini committed Mar 15, 2023
1 parent 8e5d13d commit c7b457a
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -31,7 +31,7 @@ internal static class WildcardPatternMatcher

public static bool IsMatch(string pattern, string input, bool timeoutFallbackResult) =>
!(string.IsNullOrWhiteSpace(pattern) || string.IsNullOrWhiteSpace(input))
&& Cache.GetOrAdd(pattern + Path.DirectorySeparatorChar, _ => new Regex(ToRegex(pattern), RegexOptions.None, RegexConstants.DefaultTimeout)) is var regex
&& Cache.GetOrAdd(pattern, _ => new Regex(ToRegex(pattern), RegexOptions.None, RegexConstants.DefaultTimeout)) is var regex
&& IsMatch(regex, input, timeoutFallbackResult);

private static bool IsMatch(Regex regex, string value, bool timeoutFallbackResult)
Expand Down

0 comments on commit c7b457a

Please sign in to comment.