[lld] Avoid repeated map lookups (NFC) (#132327)

This commit is contained in:
Kazu Hirata 2025-03-21 02:24:43 -07:00 committed by GitHub
parent 7f8451c868
commit 690b8b4e94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1278,8 +1278,7 @@ void Writer::createImportTables() {
continue;
std::string dll = StringRef(file->dllName).lower();
if (ctx.config.dllOrder.count(dll) == 0)
ctx.config.dllOrder[dll] = ctx.config.dllOrder.size();
ctx.config.dllOrder.try_emplace(dll, ctx.config.dllOrder.size());
if (file->impSym && !isa<DefinedImportData>(file->impSym))
Fatal(ctx) << file->symtab.printSymbol(file->impSym) << " was replaced";