Skip to content

Commit 8d8bede

Browse files
[Bufferization] Avoid repeated hash lookups (NFC) (#108925)
1 parent 539f916 commit 8d8bede

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,8 @@ static bool isReachable(Block *from, Block *to, ArrayRef<Block *> except) {
284284
continue;
285285
if (next == to)
286286
return true;
287-
if (visited.contains(next))
287+
if (!visited.insert(next).second)
288288
continue;
289-
visited.insert(next);
290289
for (Block *succ : next->getSuccessors())
291290
worklist.push_back(succ);
292291
}

0 commit comments

Comments
 (0)