Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

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

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.

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 more_search_replace branch from 3bce67b to f70d30a Compare April 29, 2015 12:38
@ellismg
Copy link
Contributor

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
@stephentoub stephentoub deleted the more_search_replace branch May 1, 2015 11:12
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…place

Cleanup a few more empty array allocations and Contract.Asserts

Commit migrated from dotnet/corefx@cd67f03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants