From 55459f67b4ebbc17d0f9a35d0987fb17e88b3db1 Mon Sep 17 00:00:00 2001 From: Arjun P Date: Wed, 2 Feb 2022 17:56:30 +0530 Subject: [PATCH] [MLIR] PresburgerSet::isIntegerEmpty: address clang-tidy warning --- mlir/lib/Analysis/Presburger/PresburgerSet.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mlir/lib/Analysis/Presburger/PresburgerSet.cpp b/mlir/lib/Analysis/Presburger/PresburgerSet.cpp index 08d15bc88c74..49c04381e1c2 100644 --- a/mlir/lib/Analysis/Presburger/PresburgerSet.cpp +++ b/mlir/lib/Analysis/Presburger/PresburgerSet.cpp @@ -369,11 +369,9 @@ bool PresburgerSet::isEqual(const PresburgerSet &set) const { /// false otherwise. bool PresburgerSet::isIntegerEmpty() const { // The set is empty iff all of the disjuncts are empty. - for (const IntegerPolyhedron &poly : integerPolyhedrons) { - if (!poly.isIntegerEmpty()) - return false; - } - return true; + return std::all_of( + integerPolyhedrons.begin(), integerPolyhedrons.end(), + [](const IntegerPolyhedron &poly) { return poly.isIntegerEmpty(); }); } bool PresburgerSet::findIntegerSample(SmallVectorImpl &sample) {