[Mlir-commits] [mlir] 6cde64a - [mlir] Apply ClangTidy fix (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Tue Aug 29 00:34:43 PDT 2023


Author: Adrian Kuegel
Date: 2023-08-29T09:33:48+02:00
New Revision: 6cde64a94986165547ae5237ac7dd4bddfc9f2a7

URL: https://github.com/llvm/llvm-project/commit/6cde64a94986165547ae5237ac7dd4bddfc9f2a7
DIFF: https://github.com/llvm/llvm-project/commit/6cde64a94986165547ae5237ac7dd4bddfc9f2a7.diff

LOG: [mlir] Apply ClangTidy fix (NFC)

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

Added: 
    

Modified: 
    mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp b/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp
index 7b0791da83ee4a..b0414637777238 100644
--- a/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp
+++ b/mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp
@@ -102,7 +102,7 @@ getLinearizedMemRefOffsetAndSize(OpBuilder &builder, Location loc, int srcBits,
                                  int dstBits, OpFoldResult offset,
                                  ArrayRef<OpFoldResult> sizes) {
   SmallVector<OpFoldResult> strides(sizes.size());
-  if (sizes.size() > 0) {
+  if (!sizes.empty()) {
     strides.back() = builder.getIndexAttr(1);
     AffineExpr s0, s1;
     bindSymbols(builder.getContext(), s0, s1);


        


More information about the Mlir-commits mailing list