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

Use ReadOnlyCollection.Empty #10013

Merged

Conversation

ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented Oct 29, 2024

Description

Replaces ReadOnlyCollection allocations with a shared singleton. I also replaced EmptyList with ReadOnlyCollection.Empty because it does the same thing, is a BCL API and allows to potentially allocate less ReadOnlyCollection instances.

Customer Impact

Better perf and memory usage.

Regression

None.

Testing

Local testing.

Risk

Low.

@ThomasGoulet73 ThomasGoulet73 requested review from a team as code owners October 29, 2024 02:08
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Oct 29, 2024
…yCollection.Empty

# Conflicts:
#	src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Schema/MemberReflector.cs
#	src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/XamlMember.cs
@ThomasGoulet73
Copy link
Contributor Author

I pulled main to fix the conflicts.

…yCollection.Empty

# Conflicts:
#	src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/XamlType.cs
@ThomasGoulet73
Copy link
Contributor Author

I pulled main to fix the conflicts.

Copy link
Contributor

@himgoyalmicro himgoyalmicro left a comment

Choose a reason for hiding this comment

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

LGTM

@himgoyalmicro himgoyalmicro merged commit e8455dc into dotnet:main Feb 19, 2025
8 checks passed
@himgoyalmicro
Copy link
Contributor

Thank you, @ThomasGoulet73, for your consistent and valuable contributions. Your hard work is greatly appreciated! 😄

@ThomasGoulet73
Copy link
Contributor Author

Thanks

@ThomasGoulet73 ThomasGoulet73 deleted the use-ReadOnlyCollection.Empty branch February 20, 2025 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants