[clang-tools-extra] r226911 - [clang-tidy] Small readability-container-size-empty cleanup

Alexander Kornienko alexfh at google.com
Fri Jan 23 06:43:06 PST 2015


Author: alexfh
Date: Fri Jan 23 08:43:06 2015
New Revision: 226911

URL: http://llvm.org/viewvc/llvm-project?rev=226911&view=rev
Log:
[clang-tidy] Small readability-container-size-empty cleanup

Utilized the hasEitherOperand instead of explicit anyOf.

http://reviews.llvm.org/D7142

Patch by Gábor Horváth!

Modified:
    clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmpty.cpp

Modified: clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmpty.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmpty.cpp?rev=226911&r1=226910&r2=226911&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmpty.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmpty.cpp Fri Jan 23 08:43:06 2015
@@ -68,8 +68,7 @@ void ContainerSizeEmptyCheck::registerMa
               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()),






More information about the cfe-commits mailing list