Skip to content

fix: cache FixableDiagnosticIds as static ImmutableArray.Empty#73

Closed
mfogliatto-dev-agent wants to merge 1 commit into
mfogliatto:mainfrom
mfogliatto-dev-agent:fix/issue-72
Closed

fix: cache FixableDiagnosticIds as static ImmutableArray.Empty#73
mfogliatto-dev-agent wants to merge 1 commit into
mfogliatto:mainfrom
mfogliatto-dev-agent:fix/issue-72

Conversation

@mfogliatto-dev-agent

Copy link
Copy Markdown

Summary

Replaces the per-access allocation in FixableDiagnosticIds with the cached ImmutableArray<string>.Empty singleton.

Before

get { return Enumerable.Empty<string>().ToImmutableArray<string>(); }

Every property access allocated a new ImmutableArray<string> via LINQ.

After

get { return ImmutableArray<string>.Empty; }

Returns the pre-allocated static empty array — zero allocations.

Fixes #72

@mfogliatto-dev-agent mfogliatto-dev-agent closed this by deleting the head repository Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Performance] ReferenceCopCodeFixProvider.FixableDiagnosticIds allocates new ImmutableArray on every access

2 participants