Skip to content

Latest commit

 

History

History
56 lines (36 loc) · 820 Bytes

RCS1068.md

File metadata and controls

56 lines (36 loc) · 820 Bytes

RCS1068: Simplify logical negation

Property Value
Id RCS1068
Category Simplification
Severity Info

Examples

Code with Diagnostic

bool f = !true; // RCS1068

Code with Fix

bool f = false;

Code with Diagnostic

bool f = !!f2; // RCS1068

Code with Fix

bool f = f2;

Code with Diagnostic

bool f = !items.Any(s => !string.IsNullOrEmpty(s)); // RCS1068

Code with Fix

bool f = items.All(s => string.IsNullOrEmpty(s));

See Also

(Generated with DotMarkdown)