Skip to content

Files

Latest commit

 

History

History
18 lines (11 loc) · 606 Bytes

RedundantIf.md

File metadata and controls

18 lines (11 loc) · 606 Bytes

Pattern: Redundant if

Issue: -

Description

If expressions with boolean constants in both branches can be eliminated without affecting readability. Prefer simply cond to if (cond) true else false and !cond to if (cond) false else true.

Example configuration

<check enabled="true" class="org.scalastyle.scalariform.RedundantIfChecker" level="warning"/>