Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide overloads to avoid unnecessary boxing #71894

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

sharwell
Copy link
Member

No description provided.

@sharwell sharwell requested a review from a team as a code owner January 31, 2024 18:49
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 31, 2024
@sharwell sharwell marked this pull request as draft January 31, 2024 18:51
@sharwell sharwell marked this pull request as ready for review January 31, 2024 18:56
/// <param name="predicate">The condition to use for filtering the array content.</param>
/// <param name="selector">A transform function to apply to each element that is not filtered out by <paramref name="predicate"/>.</param>
/// <returns>If the items's length is 0, this will return an empty immutable array.</returns>
public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, ImmutableArray<TResult>> selector)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 There were two callers of the previous overload prior to this change. After this change, there is one caller of the previous overload, and one caller of the new overload.

/// <param name="array">The array to transform</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <returns>If the array's length is 0, this will return an empty immutable array.</returns>
public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, ImmutableArray<TResult>> selector)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 There were 16 callers of the previous overload prior to this change. After this change, there are 3 callers of the previous overload, and 13 callers of the new overload.

@sharwell sharwell merged commit 0deb93a into dotnet:main Feb 1, 2024
25 checks passed
@sharwell sharwell deleted the unnecessary-box branch February 1, 2024 13:38
@ghost ghost added this to the Next milestone Feb 1, 2024
@jjonescz jjonescz modified the milestones: Next, 17.10 P2 Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants