Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

redundant-equals

Flag comparison to a logical literal: x == TRUE is just x, and x == FALSE is !x.

Comparing to TRUE:

if (ready == TRUE) go()
warning: redundant-equals
 --> example.R:1:5
  |
1 | if (ready == TRUE) go()
  |     ^^^^^^^^^^^^^ comparison with a logical literal is redundant
  = help: Use the expression directly, or negate it.

After applying the fix:

if (ready) go()