Skip to content

Commit 0a20ab9

Browse files
[mlir] Avoid repeated hash lookups (NFC) (#112472)
1 parent 3a56b03 commit 0a20ab9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Dialect/MLProgram/Transforms/PipelineGlobalOps.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ void MLProgramPipelineGlobals::processBlock(
148148
if (auto store = mlir::dyn_cast<GlobalStoreOp>(op)) {
149149
auto ref = store.getGlobal();
150150
symbolStore.insert(ref);
151-
if (previousStores.contains(ref)) {
152-
toDelete.push_back(previousStores.find(ref)->getSecond());
151+
auto it = previousStores.find(ref);
152+
if (it != previousStores.end()) {
153+
toDelete.push_back(it->getSecond());
153154
}
154155

155156
previousLoads[ref] = store.getValue();

0 commit comments

Comments
 (0)