From 13435d15b3eca18df20a31e726cdfb83e6b24c40 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 18 Sep 2023 15:41:38 -0400 Subject: [PATCH] Add some more nullability to MatchUtil --- MatchUtil.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MatchUtil.cs b/MatchUtil.cs index 81d6e11..33fdd26 100644 --- a/MatchUtil.cs +++ b/MatchUtil.cs @@ -219,7 +219,11 @@ namespace SabreTools.Matching /// Enumerable of PathMatchSets to be run on the file /// True if any path match is a success, false if all have to match /// List of strings representing the matched protections, null or empty otherwise +#if NET48 public static ConcurrentQueue GetAllMatches(string file, IEnumerable matchers, bool any = false) +#else + public static ConcurrentQueue GetAllMatches(string file, IEnumerable? matchers, bool any = false) +#endif { return FindAllMatches(new List { file }, matchers, any, false); } @@ -231,7 +235,11 @@ namespace SabreTools.Matching /// Enumerable of PathMatchSets to be run on the file /// True if any path match is a success, false if all have to match /// List of strings representing the matched protections, null or empty otherwise +#if NET48 public static ConcurrentQueue GetAllMatches(IEnumerable files, IEnumerable matchers, bool any = false) +#else + public static ConcurrentQueue GetAllMatches(IEnumerable? files, IEnumerable? matchers, bool any = false) +#endif { return FindAllMatches(files, matchers, any, false); } @@ -284,7 +292,11 @@ namespace SabreTools.Matching /// True if any path match is a success, false if all have to match /// True to stop after the first match, false otherwise /// List of strings representing the matched protections, null or empty otherwise +#if NET48 private static ConcurrentQueue FindAllMatches(IEnumerable files, IEnumerable matchers, bool any, bool stopAfterFirst) +#else + private static ConcurrentQueue FindAllMatches(IEnumerable? files, IEnumerable? matchers, bool any, bool stopAfterFirst) +#endif { // If there's no mappings, we can't match if (matchers == null || !matchers.Any())