Skip to content

Commit 0aa5b5d

Browse files
kazutakahirataDanielCChen
authored andcommitted
[BOLT] Avoid repeated hash lookups (NFC) (llvm#111782)
1 parent c3c8f4f commit 0aa5b5d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

bolt/lib/Profile/YAMLProfileReader.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,7 @@ size_t YAMLProfileReader::matchWithNameSimilarity(BinaryContext &BC) {
643643
// equal number of blocks.
644644
if (NamespaceToProfiledBFSizesIt->second.count(BF->size()) == 0)
645645
continue;
646-
auto NamespaceToBFsIt = NamespaceToBFs.find(Namespace);
647-
if (NamespaceToBFsIt == NamespaceToBFs.end())
648-
NamespaceToBFs[Namespace] = {BF};
649-
else
650-
NamespaceToBFsIt->second.push_back(BF);
646+
NamespaceToBFs[Namespace].push_back(BF);
651647
}
652648

653649
// Iterates through all profiled functions and binary functions belonging to

0 commit comments

Comments
 (0)