[clang-tidy] Small readability-container-size-empty cleanup
authorAlexander Kornienko <alexfh@google.com>
Fri, 23 Jan 2015 14:43:06 +0000 (14:43 +0000)
committerAlexander Kornienko <alexfh@google.com>
Fri, 23 Jan 2015 14:43:06 +0000 (14:43 +0000)
Utilized the hasEitherOperand instead of explicit anyOf.

http://reviews.llvm.org/D7142

Patch by Gábor Horváth!

llvm-svn: 226911

clang-tools-extra/clang-tidy/readability/ContainerSizeEmpty.cpp

index 407da55aee0455e1fdd0cca47fd8df471cca22aa..b7c1534fed76dc91af76bd50293afa337513ac1e 100644 (file)
@@ -68,8 +68,7 @@ void ContainerSizeEmptyCheck::registerMatchers(MatchFinder *Finder) {
               anyOf(has(integerLiteral(equals(0))),
                     allOf(anyOf(hasOperatorName("<"), hasOperatorName(">="),
                                 hasOperatorName(">"), hasOperatorName("<=")),
-                          anyOf(hasRHS(integerLiteral(equals(1))),
-                                hasLHS(integerLiteral(equals(1)))))))
+                          hasEitherOperand(integerLiteral(equals(1))))))
               .bind("SizeBinaryOp")),
       hasParent(implicitCastExpr(
           hasImplicitDestinationType(isBoolType()),