Skip to content

Commit edfb6dd

Browse files
[MC] Avoid repeated hash lookups (NFC) (#110791)
1 parent 323b3a7 commit edfb6dd

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)