[Mlir-commits] [mlir] a8919c4 - [mlir] Apply ClangTidy fix (NFC)
Adrian Kuegel
llvmlistbot at llvm.org
Wed Sep 27 00:15:56 PDT 2023
Author: Adrian Kuegel
Date: 2023-09-27T07:15:03Z
New Revision: a8919c413b4aac9ff485c58816b512764a079505
URL: https://github.com/llvm/llvm-project/commit/a8919c413b4aac9ff485c58816b512764a079505
DIFF: https://github.com/llvm/llvm-project/commit/a8919c413b4aac9ff485c58816b512764a079505.diff
LOG: [mlir] Apply ClangTidy fix (NFC)
Prefer to use .empty() instead of checking size().
Added:
Modified:
mlir/lib/IR/Attributes.cpp
Removed:
################################################################################
diff --git a/mlir/lib/IR/Attributes.cpp b/mlir/lib/IR/Attributes.cpp
index c572f120916473c..cc7a2a5e586b1cd 100644
--- a/mlir/lib/IR/Attributes.cpp
+++ b/mlir/lib/IR/Attributes.cpp
@@ -43,7 +43,7 @@ MLIRContext *Attribute::getContext() const { return getDialect().getContext(); }
NamedAttribute::NamedAttribute(StringAttr name, Attribute value)
: name(name), value(value) {
assert(name && value && "expected valid attribute name and value");
- assert(name.size() != 0 && "expected valid attribute name");
+ assert(!name.empty() && "expected valid attribute name");
}
StringAttr NamedAttribute::getName() const {
More information about the Mlir-commits
mailing list