Skip to content

Commit 67e7f05

Browse files
[Dialect] Avoid repeated hash lookups (NFC) (#108319)
1 parent 85c97c1 commit 67e7f05

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlir/lib/Dialect/Transform/IR/TransformOps.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,10 +1588,8 @@ transform::GetParentOp::apply(transform::TransformRewriter &rewriter,
15881588
}
15891589
}
15901590
if (getDeduplicate()) {
1591-
if (!resultSet.contains(parent)) {
1591+
if (resultSet.insert(parent).second)
15921592
parents.push_back(parent);
1593-
resultSet.insert(parent);
1594-
}
15951593
} else {
15961594
parents.push_back(parent);
15971595
}

0 commit comments

Comments
 (0)