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

Projects
None yet
5 participants
@stephentoub
Member

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 some commits Apr 29, 2015

Use Array.Empty<T>() in a few more places
Removing two occurences of:
```
private static readonly T[] s_emptyArray = new T[0];
```
fields, and replacing call sites with usage of ```Array.Empty<T>()```.
Replace more Contract.Asserts with Debug.Asserts
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.
@ellismg

This comment has been minimized.

Show comment
Hide comment
@ellismg

ellismg Apr 30, 2015

Contributor

LGTM

Contributor

ellismg commented Apr 30, 2015

LGTM

ellismg added a commit that referenced this pull request Apr 30, 2015

Merge pull request #1579 from stephentoub/more_search_replace
Cleanup a few more empty array allocations and Contract.Asserts

@ellismg ellismg merged commit cd67f03 into dotnet:master Apr 30, 2015

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