Skip to content

Commit 24892b8

Browse files
[MC] Avoid repeated hash lookups (NFC) (llvm#123502)
1 parent 6a5a795 commit 24892b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/MC/ELFObjectWriter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,8 @@ void ELFObjectWriter::executePostLayoutBinding(MCAssembler &Asm) {
12191219
continue;
12201220
}
12211221

1222-
if (Renames.count(&Symbol) && Renames[&Symbol] != Alias) {
1222+
if (auto It = Renames.find(&Symbol);
1223+
It != Renames.end() && It->second != Alias) {
12231224
Asm.getContext().reportError(S.Loc, Twine("multiple versions for ") +
12241225
Symbol.getName());
12251226
continue;

0 commit comments

Comments
 (0)