Skip to content

Commit 05209f1

Browse files
[ExecutionEngine] Avoid repeated hash lookups (NFC) (llvm#127303)
1 parent 9453b38 commit 05209f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,12 @@ void MachOPlatform::pushInitializersLoop(
635635
Worklist.pop_back();
636636

637637
// If we've already visited this JITDylib on this iteration then continue.
638-
if (JDDepMap.count(DepJD))
638+
auto [It, Inserted] = JDDepMap.try_emplace(DepJD);
639+
if (!Inserted)
639640
continue;
640641

641642
// Add dep info.
642-
auto &DM = JDDepMap[DepJD];
643+
auto &DM = It->second;
643644
DepJD->withLinkOrderDo([&](const JITDylibSearchOrder &O) {
644645
for (auto &KV : O) {
645646
if (KV.first == DepJD)

0 commit comments

Comments
 (0)