[Mlir-commits] [mlir] 0db8a14 - [mlir] Apply ClangTidy readability fix.
Adrian Kuegel
llvmlistbot at llvm.org
Wed Aug 24 01:35:03 PDT 2022
Author: Adrian Kuegel
Date: 2022-08-24T10:34:26+02:00
New Revision: 0db8a140f63ef0d4b14277f333ed47251bf7c872
URL: https://github.com/llvm/llvm-project/commit/0db8a140f63ef0d4b14277f333ed47251bf7c872
DIFF: https://github.com/llvm/llvm-project/commit/0db8a140f63ef0d4b14277f333ed47251bf7c872.diff
LOG: [mlir] Apply ClangTidy readability fix.
Use .empty() instead of checking for size() == 0.
Added:
Modified:
mlir/lib/IR/AsmPrinter.cpp
Removed:
################################################################################
diff --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index 009ce07025c70..dcd4ef60294b3 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -1861,7 +1861,7 @@ void AsmPrinter::Impl::printAttribute(Attribute attr,
} else if (auto denseArrayAttr = attr.dyn_cast<DenseArrayBaseAttr>()) {
typeElision = AttrTypeElision::Must;
os << "array<" << denseArrayAttr.getType().getElementType();
- if (denseArrayAttr.size())
+ if (!denseArrayAttr.empty())
os << ": ";
denseArrayAttr.printWithoutBraces(os);
os << ">";
More information about the Mlir-commits
mailing list