Description
UseGuard.NotNegative() instead of verbose negative-check and throw patterns.
Bad Code
Good Code
Properties
- Category: Roslyn Utilities
- Severity: Warning
- Enabled by default: True
- Code fix available: True
Use Guard.NotNegative() instead of verbose if (x < 0) throw patterns
Guard.NotNegative() instead of verbose negative-check and throw patterns.