[PATCH] [Clang Tidy] Small readability-container-size-empty cleanup

Gábor Horváth xazax.hun at gmail.com
Fri Jan 23 05:40:07 PST 2015


Hi alexfh,

Utilized the hasEitherOperand instead of explicit anyOf.

http://reviews.llvm.org/D7142

Files:
  clang-tidy/readability/ContainerSizeEmpty.cpp

Index: clang-tidy/readability/ContainerSizeEmpty.cpp
===================================================================
--- clang-tidy/readability/ContainerSizeEmpty.cpp
+++ clang-tidy/readability/ContainerSizeEmpty.cpp
@@ -68,8 +68,7 @@
               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()),

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7142.18666.patch
Type: text/x-patch
Size: 789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150123/892e4c5c/attachment.bin>


More information about the cfe-commits mailing list