[Mlir-commits] [mlir] 398e48a - [mlir] Apply ClangTidy fix (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Thu Oct 12 22:55:15 PDT 2023


Author: Adrian Kuegel
Date: 2023-10-13T05:54:30Z
New Revision: 398e48a75ba1ce7f2d42c0260f28218936c47073

URL: https://github.com/llvm/llvm-project/commit/398e48a75ba1ce7f2d42c0260f28218936c47073
DIFF: https://github.com/llvm/llvm-project/commit/398e48a75ba1ce7f2d42c0260f28218936c47073.diff

LOG: [mlir] Apply ClangTidy fix (NFC)

Prefer to use .empty() instead of checking size() == 0.

Added: 
    

Modified: 
    mlir/lib/AsmParser/AttributeParser.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/AsmParser/AttributeParser.cpp b/mlir/lib/AsmParser/AttributeParser.cpp
index b1991ce06f6eab5..8366c18760fd64c 100644
--- a/mlir/lib/AsmParser/AttributeParser.cpp
+++ b/mlir/lib/AsmParser/AttributeParser.cpp
@@ -309,7 +309,7 @@ ParseResult Parser::parseAttributeDict(NamedAttrList &attributes) {
     else
       return emitWrongTokenError("expected attribute name");
 
-    if (nameId->size() == 0)
+    if (nameId->empty())
       return emitError("expected valid attribute name");
 
     if (!seenKeys.insert(*nameId).second)


        


More information about the Mlir-commits mailing list