Skip to content

Commit 87e5e8d

Browse files
committed
Address Copilot comment about CompileMatcher constructor with IEnumerable<string>
1 parent 04e3c31 commit 87e5e8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Microsoft.ComponentDetection.Common/PatternMatchingUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public sealed class CompiledMatcher
7979
private readonly string[] patterns;
8080

8181
public CompiledMatcher(IEnumerable<string> patterns)
82-
: this(patterns?.ToArray()!)
82+
: this(patterns is string[] arr ? arr : (patterns ?? throw new ArgumentNullException(nameof(patterns))).ToArray())
8383
{
8484
}
8585

0 commit comments

Comments
 (0)