Skip to content

Commit 1641745

Browse files
[lld] Avoid repeated hash lookups (NFC) (llvm#112119)
1 parent 9220f64 commit 1641745

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lld/ELF/Arch/ARM.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,10 +1103,11 @@ static void toLittleEndianInstructions(uint8_t *buf, uint64_t start,
11031103
// [$t, non $t) and convert these to little endian a word or half word at a
11041104
// time respectively.
11051105
void elf::convertArmInstructionstoBE8(InputSection *sec, uint8_t *buf) {
1106-
if (!sectionMap.contains(sec))
1106+
auto it = sectionMap.find(sec);
1107+
if (it == sectionMap.end())
11071108
return;
11081109

1109-
SmallVector<const Defined *, 0> &mapSyms = sectionMap[sec];
1110+
SmallVector<const Defined *, 0> &mapSyms = it->second;
11101111

11111112
if (mapSyms.empty())
11121113
return;

0 commit comments

Comments
 (0)