[ExecutionEngine] Avoid repeated hash lookups (NFC) (#127303)

This commit is contained in:
Kazu Hirata 2025-02-15 01:37:02 -08:00 committed by GitHub
parent 9453b38ac7
commit 05209f1e59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -635,11 +635,12 @@ void MachOPlatform::pushInitializersLoop(
Worklist.pop_back();
// If we've already visited this JITDylib on this iteration then continue.
if (JDDepMap.count(DepJD))
auto [It, Inserted] = JDDepMap.try_emplace(DepJD);
if (!Inserted)
continue;
// Add dep info.
auto &DM = JDDepMap[DepJD];
auto &DM = It->second;
DepJD->withLinkOrderDo([&](const JITDylibSearchOrder &O) {
for (auto &KV : O) {
if (KV.first == DepJD)