Skip to content

Commit 6ffa7cd

Browse files
[Interfaces] Avoid repeated hash lookups (NFC) (#108140)
1 parent 4b1b450 commit 6ffa7cd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mlir/lib/Interfaces/ValueBoundsOpInterface.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,8 @@ LogicalResult ValueBoundsConstraintSet::computeIndependentBound(
605605
worklist.push_back(v);
606606
while (!worklist.empty()) {
607607
Value next = worklist.pop_back_val();
608-
if (visited.contains(next))
608+
if (!visited.insert(next).second)
609609
continue;
610-
visited.insert(next);
611610
if (llvm::is_contained(independencies, next))
612611
return false;
613612
// TODO: DominanceInfo could be used to stop the traversal early.

0 commit comments

Comments
 (0)