Skip to content

Commit c219ebd

Browse files
[ExecutionEngine] Avoid repeated hash lookups (NFC) (#109563)
1 parent 46df454 commit c219ebd

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/ExecutionEngine/JITLink/DefineExternalSectionStartAndEndSymbols.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ class DefineExternalSectionStartAndEndSymbols {
7171

7272
private:
7373
SectionRange &getSectionRange(Section &Sec) {
74-
auto I = SectionRanges.find(&Sec);
75-
if (I == SectionRanges.end())
76-
I = SectionRanges.insert(std::make_pair(&Sec, SectionRange(Sec))).first;
77-
return I->second;
74+
return SectionRanges.try_emplace(&Sec, Sec).first->second;
7875
}
7976

8077
DenseMap<Section *, SectionRange> SectionRanges;

0 commit comments

Comments
 (0)