Skip to content

Commit 690b8b4

Browse files
[lld] Avoid repeated map lookups (NFC) (#132327)
1 parent 7f8451c commit 690b8b4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lld/COFF/Writer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,7 @@ void Writer::createImportTables() {
12781278
continue;
12791279

12801280
std::string dll = StringRef(file->dllName).lower();
1281-
if (ctx.config.dllOrder.count(dll) == 0)
1282-
ctx.config.dllOrder[dll] = ctx.config.dllOrder.size();
1281+
ctx.config.dllOrder.try_emplace(dll, ctx.config.dllOrder.size());
12831282

12841283
if (file->impSym && !isa<DefinedImportData>(file->impSym))
12851284
Fatal(ctx) << file->symtab.printSymbol(file->impSym) << " was replaced";

0 commit comments

Comments
 (0)