Skip to content

Commit 2370f30

Browse files
kazutakahirataSterling-Augustine
authored andcommitted
[MC] Avoid repeated hash lookups (NFC) (llvm#110791)
1 parent 35d77c4 commit 2370f30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/MC/XCOFFObjectWriter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,9 @@ void XCOFFObjectWriter::recordRelocation(MCAssembler &Asm,
666666
// If we could not find the symbol directly in SymbolIndexMap, this symbol
667667
// could either be a temporary symbol or an undefined symbol. In this case,
668668
// we would need to have the relocation reference its csect instead.
669-
return SymbolIndexMap.contains(Sym)
670-
? SymbolIndexMap[Sym]
669+
auto It = SymbolIndexMap.find(Sym);
670+
return It != SymbolIndexMap.end()
671+
? It->second
671672
: SymbolIndexMap[ContainingCsect->getQualNameSymbol()];
672673
};
673674

0 commit comments

Comments
 (0)