[Mlir-commits] [mlir] 56f5e4a - Replace raw-loop with llvm::any_of() in PresburgerSet.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sun Jan 2 14:40:31 PST 2022


Author: Mehdi Amini
Date: 2022-01-02T22:39:57Z
New Revision: 56f5e4abb83fb5d668e0f12e64d68a510beead03

URL: https://github.com/llvm/llvm-project/commit/56f5e4abb83fb5d668e0f12e64d68a510beead03
DIFF: https://github.com/llvm/llvm-project/commit/56f5e4abb83fb5d668e0f12e64d68a510beead03.diff

LOG: Replace raw-loop with llvm::any_of() in PresburgerSet.cpp (NFC)

Reported by clang-tidy.

Added: 
    

Modified: 
    mlir/lib/Analysis/PresburgerSet.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/PresburgerSet.cpp b/mlir/lib/Analysis/PresburgerSet.cpp
index 22ea7a3a7eec..981622140050 100644
--- a/mlir/lib/Analysis/PresburgerSet.cpp
+++ b/mlir/lib/Analysis/PresburgerSet.cpp
@@ -85,11 +85,10 @@ PresburgerSet PresburgerSet::unionSet(const PresburgerSet &set) const {
 
 /// A point is contained in the union iff any of the parts contain the point.
 bool PresburgerSet::containsPoint(ArrayRef<int64_t> point) const {
-  for (const FlatAffineConstraints &fac : flatAffineConstraints) {
-    if (fac.containsPoint(point))
-      return true;
-  }
-  return false;
+  return llvm::any_of(flatAffineConstraints,
+                      [&](const FlatAffineConstraints &fac) {
+                        return (fac.containsPoint(point));
+                      });
 }
 
 PresburgerSet PresburgerSet::getUniverse(unsigned nDim, unsigned nSym) {


        


More information about the Mlir-commits mailing list