Check for unnecessary conditions in if statements
true
and false
shouldn't be used directly in if-statements as it make the statements harder to read and doesn't provide any additional information. It might also hide unreachable code. Examples:
if constexpr (true || !mMainWindow->isLoading())
//better:
if constexpr (!mMainWindow->isLoading())
if constexpr ( false && vanishPointIsInsideImage )
//better: (or remove, as it hides unreachable code)
if constexpr ( vanishPointIsInsideImage )
Quick text search for if (false)
yields 7 results.
Edited by Schrödter, Tobias