Skip to content

Commit

Permalink
Merge pull request #9569 from ToddGrun/RemoveUnnecessaryAllocationinR…
Browse files Browse the repository at this point in the history
…estoreBuilderToReferenceItems

Remove an unnecessary allocation from RestoreBuilder.ToReferenceItems
  • Loading branch information
drewnoakes authored Oct 29, 2024
2 parents 4aab68c + dc8afb2 commit 4341760
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,7 @@ public static ProjectRestoreInfo ToProjectRestoreInfo(IImmutableDictionary<strin

static ImmutableArray<ReferenceItem> ToReferenceItems(IImmutableDictionary<string, IImmutableDictionary<string, string>> items)
{
return items.ToImmutableArray(static (key, value) => ToReferenceItem(key, value));

static ReferenceItem ToReferenceItem(string name, IImmutableDictionary<string, string> metadata)
{
var properties = metadata.ToImmutableArray(static (key, value) => new ReferenceProperty(key, value));

return new ReferenceItem(name, metadata);
}
return items.ToImmutableArray(static (name, metadata) => new ReferenceItem(name, metadata));
}
}
}
Expand Down

0 comments on commit 4341760

Please sign in to comment.