Skip to content

Commit 4b1b450

Browse files
[Transforms] Avoid repeated hash lookups (NFC) (#108139)
1 parent 7dfaedf commit 4b1b450

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mlir/lib/Transforms/Utils/DialectConversion.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,9 +2486,8 @@ static void eraseDeadUnrealizedCasts(
24862486

24872487
// Do not visit ops multiple times. If we find a circle, no live user was
24882488
// found on the current path.
2489-
if (visited.contains(op))
2489+
if (!visited.insert(op).second)
24902490
return false;
2491-
visited.insert(op);
24922491

24932492
// Visit all users.
24942493
for (Operation *user : op->getUsers()) {

0 commit comments

Comments
 (0)