Skip to content

Commit

Permalink
[lld] Avoid repeated hash lookups (NFC) (#112119)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Oct 13, 2024
1 parent 9220f64 commit 1641745
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lld/ELF/Arch/ARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1641745

Please sign in to comment.