[Analyzer]: Regex.IsMatch guarding Regex.Match #111239
Labels
api-ready-for-review
API is ready for review, it is NOT ready for implementation
area-System.Text.RegularExpressions
code-analyzer
Marks an issue that suggests a Roslyn analyzer
code-fixer
Marks an issue that suggests a Roslyn code fixer
In looking through various code bases, I've seen the following pattern repeatedly:
That just doubles the work involved when there is a match. It should instead be:
or something similar. We should have an analyzer that flags these duplicative guards and a fixer that transforms into something like the latter.
The text was updated successfully, but these errors were encountered: