Apply clang-tidy fixes for modernize-loop-convert to MLIR (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Mon, 7 Mar 2022 10:12:39 +0000 (10:12 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 7 Mar 2022 10:41:44 +0000 (10:41 +0000)
mlir/lib/Dialect/Linalg/Transforms/SparseTensorRewriting.cpp

index 72d4994..16ae9d1 100644 (file)
@@ -35,8 +35,8 @@ static bool isSparseTensor(OpOperand *op) {
   if (auto enc = getSparseTensorEncoding(op->get().getType())) {
     ArrayRef<SparseTensorEncodingAttr::DimLevelType> dimTypes =
         enc.getDimLevelType();
-    for (unsigned i = 0, e = dimTypes.size(); i < e; i++)
-      if (dimTypes[i] == SparseTensorEncodingAttr::DimLevelType::Compressed)
+    for (auto dimType : dimTypes)
+      if (dimType == SparseTensorEncodingAttr::DimLevelType::Compressed)
         return true; // at least one compressed
   }
   return false;