Skip to content

Commit 65a5b18

Browse files
[Shape] Avoid repeated hash lookups (NFC) (#108926)
1 parent 8d8bede commit 65a5b18

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlir/lib/Dialect/Shape/Transforms/OutlineShapeComputation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,8 @@ void OutlineShapeComputationPass::getClusterFromValue(
292292
cluster.insert(op);
293293
for (Value inp : op->getOperands()) {
294294
Operation *inpDefOp = inp.getDefiningOp();
295-
if (nullptr != inpDefOp && !visited.contains(inpDefOp)) {
296-
visited.insert(inpDefOp);
295+
if (nullptr != inpDefOp && visited.insert(inpDefOp).second)
297296
queue.push(inpDefOp);
298-
}
299297
}
300298
}
301299
}

0 commit comments

Comments
 (0)