Skip to content

Remove-Redundant-Boolean

Documentation Index

Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt

Use this file to discover all available pages before exploring further.

Sourcery rule id: remove-redundant-boolean

Section titled “Sourcery rule id: remove-redundant-boolean”

Remove unnecessary boolean value

while (first_condition && true && second_condition) {
do_something();
}
while (first_condition && second_condition) {
do_something();
}

This rule removes unnecessary true values from && boolean operators, since something && true has exactly the same meaning as something