Skip to content

Commit e768297

Browse files
authored
Merge pull request #43100 from sharwell/is-match
🐇 Use Regex.IsMatch instead of Regex.Match when no groups are needed
2 parents e5a21b2 + 430ce46 commit e768297

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)