-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Apply IDE0300 to corelib (use collection expressions instead of new[]) #105122
Conversation
Tagging subscribers to this area: @dotnet/area-meta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means many of these become stackallocs and now use the params ROSpan<T>
overloads, correct?
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/OrdinalCasing.Icu.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs
Show resolved
Hide resolved
For this particular round of changes, most if not all of the cases I converted were target typed to T[], so the collection expressions are still forced to produce an array. However, for any where the target type was instead span, or where it is an argument to a method that has an overload that takes a span instead, then the compiler will do better, either using stack allocation or using assembly data if all elements were constant and the target is read only. |
/ba-g unknown failure was a wasi leg not running a test |
No description provided.