I see many instances of useless checks like
if(true == someFunctionThatReturnsABoolean()) vs if(someFunctionThatReturnsABoolean())
Or google test
EXPECT_EQ(TRUE, someValue) vs EXPECT_TRUE(someValue)
same for false.
Maybe a check to encourage people to keep it simple...
clang-tidy has a readability-simplify-boolean-expr check.
Thanks, we currently aren't using that tool but I'll look into it.
Log in to post a comment.
I see many instances of useless checks like
if(true == someFunctionThatReturnsABoolean()) vs if(someFunctionThatReturnsABoolean())
Or google test
EXPECT_EQ(TRUE, someValue) vs EXPECT_TRUE(someValue)
same for false.
Maybe a check to encourage people to keep it simple...
clang-tidy has a readability-simplify-boolean-expr check.
Thanks, we currently aren't using that tool but I'll look into it.