Skip to content

Commit 42e5592

Browse files
[ExecutionEngine] Avoid repeated hash lookups (NFC) (#128997)
1 parent c54e6fb commit 42e5592

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,10 @@ Error StaticLibraryDefinitionGenerator::tryToGenerate(
398398

399399
for (const auto &KV : Symbols) {
400400
const auto &Name = KV.first;
401-
if (!ObjectFilesMap.count(Name))
401+
auto It = ObjectFilesMap.find(Name);
402+
if (It == ObjectFilesMap.end())
402403
continue;
403-
auto ChildBuffer = ObjectFilesMap[Name];
404+
auto ChildBuffer = It->second;
404405
ChildBufferInfos.insert(
405406
{ChildBuffer.getBuffer(), ChildBuffer.getBufferIdentifier()});
406407
}

0 commit comments

Comments
 (0)