[lld] Avoid repeated hash lookups (NFC) (#112119)

This commit is contained in:
Kazu Hirata 2024-10-13 07:33:32 -07:00 committed by GitHub
parent 9220f64520
commit 1641745530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1103,10 +1103,11 @@ static void toLittleEndianInstructions(uint8_t *buf, uint64_t start,
// [$t, non $t) and convert these to little endian a word or half word at a
// time respectively.
void elf::convertArmInstructionstoBE8(InputSection *sec, uint8_t *buf) {
if (!sectionMap.contains(sec))
auto it = sectionMap.find(sec);
if (it == sectionMap.end())
return;
SmallVector<const Defined *, 0> &mapSyms = sectionMap[sec];
SmallVector<const Defined *, 0> &mapSyms = it->second;
if (mapSyms.empty())
return;