[ExecutionEngine] Avoid repeated map lookups (NFC) (#135541)

This commit is contained in:
Kazu Hirata 2025-04-13 05:46:15 -07:00 committed by GitHub
parent 62d2cc84ac
commit 4b4cd645a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -475,8 +475,9 @@ Error DebugObjectManagerPlugin::notifyEmitted(
FinalizePromise.set_value(MR.withResourceKeyDo([&](ResourceKey K) {
assert(PendingObjs.count(&MR) && "We still hold PendingObjsLock");
std::lock_guard<std::mutex> Lock(RegisteredObjsLock);
RegisteredObjs[K].push_back(std::move(PendingObjs[&MR]));
PendingObjs.erase(&MR);
auto It = PendingObjs.find(&MR);
RegisteredObjs[K].push_back(std::move(It->second));
PendingObjs.erase(It);
}));
});