mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:54:41 +01:00
Change lexical lookup to use an array instead of hash map. (#3582)
This is primarily being done for performance reasons, removing hash lookups. The increased memory consumption is accepted. Refactors LexicalLookup out to its own structure.
This commit is contained in:
@@ -57,7 +57,8 @@ static auto CopyNameFromImportIR(Context& context,
|
||||
if (auto import_identifier_id = import_name_id.AsIdentifierId();
|
||||
import_identifier_id.is_valid()) {
|
||||
auto name = import_sem_ir.identifiers().Get(import_identifier_id);
|
||||
return SemIR::NameId::ForIdentifier(context.identifiers().Add(name));
|
||||
return SemIR::NameId::ForIdentifier(
|
||||
context.lexical_lookup().AddIdentifier(name));
|
||||
}
|
||||
return import_name_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user