Skip to content

Commit b2dbcf4

Browse files
[Presburger] Avoid repeated hash lookups (NFC) (#107426)
1 parent 4d819da commit b2dbcf4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlir/lib/Analysis/Presburger/IntegerRelation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,10 +2367,8 @@ bool IntegerRelation::removeDuplicateConstraints() {
23672367
hashTable.insert({row, 0});
23682368
for (unsigned k = 1; k < ineqs; ++k) {
23692369
row = getInequality(k).drop_back();
2370-
if (!hashTable.contains(row)) {
2371-
hashTable.insert({row, k});
2370+
if (hashTable.try_emplace(row, k).second)
23722371
continue;
2373-
}
23742372

23752373
// For identical cases, keep only the smaller part of the constant term.
23762374
unsigned l = hashTable[row];

0 commit comments

Comments
 (0)