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

Cleanup a few more empty array allocations and Contract.Asserts #1579

Merged
merged 2 commits into from Apr 30, 2015

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Apr 29, 2015

Two search-and-replace changes:

  1. Replaced two more private static readonly T[] s_emptyArray = new T[0]; occurrences with usage of Array.Empty<T>().
  2. Replaced some more Contract.Asserts that snuck in with Debug.Asserts, continuing with our policy of standardizing on Debug.Assert for asserts.
stephentoub added 2 commits Apr 29, 2015
Removing two occurences of:
```
private static readonly T[] s_emptyArray = new T[0];
```
fields, and replacing call sites with usage of ```Array.Empty<T>()```.
A few more Contract.Assert calls have snuck in.  Continuing on our policy of standardizing on Debug.Assert for asserts, replacing all of them.  The only Contract.Assert calls that currently remain in the repo after this are those used in System.Diagnostics.Contracts tests.
@stephentoub stephentoub force-pushed the stephentoub:more_search_replace branch from 3bce67b to f70d30a Apr 29, 2015
@ellismg
Copy link
Contributor

@ellismg ellismg commented Apr 30, 2015

LGTM

ellismg added a commit that referenced this pull request Apr 30, 2015
Cleanup a few more empty array allocations and Contract.Asserts
@ellismg ellismg merged commit cd67f03 into dotnet:master Apr 30, 2015
1 check passed
1 check passed
default Merged build finished.
Details
@stephentoub stephentoub deleted the stephentoub:more_search_replace branch May 1, 2015
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.