Skip to content

Commit 430ce46

Browse files
committed
Use Regex.IsMatch instead of Regex.Match when no groups are needed
1 parent 8017891 commit 430ce46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Compilers/Core/Portable/CommandLine/AnalyzerConfig.SectionNameMatching.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ internal SectionNameMatcher(
3131

3232
public bool IsMatch(string s)
3333
{
34+
if (_numberRangePairs.IsEmpty)
35+
{
36+
return Regex.IsMatch(s);
37+
}
38+
3439
var match = Regex.Match(s);
3540
if (!match.Success)
3641
{

0 commit comments

Comments
 (0)