Skip to content

An opportunity for optimization in ImmutableArrayExtensions.CreateNameToMembersMap #67990

@AlekseyTs

Description

@AlekseyTs

members = hasNamespaces
? builder.ToImmutable()
: ImmutableArray<TNamespaceOrTypeSymbol>.CastUp(builder.ToDowncastedImmutable<TNamedTypeSymbol>());
builder.Free();

One branch could do builder.ToImmutableAndFree(), which would allow for the optimization of moving the internal array to the immutable array without a copy.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions