-
Notifications
You must be signed in to change notification settings - Fork 723
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
Minimize + Centralize empty array declarations #4042
Conversation
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.
The idea and changes are good.
You forgot one in framework
directory in DefaultSuiteBuilder.cs
: IFixtureBuilder[] attrs = new IFixtureBuilder[0];
I assume you deliberately ignored zero array allocations in the testdata
and tests
directories.
Thanks @manfred-brands ! I've pushed an update to add the missed opportunity in |
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.
I would not do more here and for main move to Array.Empty
once we have a minimum target of net462
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.
Only one comment, but I'm also happy to merge it as it is
Fixes #4041
This PR introduces a helper to cache empty array declarations. It will use
Array.Empty<T>
if possible, falling back to a custom implementation when that's not available.This should be ported to v4 unless we decide to drop support for net45 there.