-
Notifications
You must be signed in to change notification settings - Fork 61
Feature suggestion: replace new List<T>() with Enumerable.Empty<T>() where appropriate #58
Comments
@mjsabby - any idea when a new update will be released including this fix from @cezarypiatek ? |
The VS extension has been updated. So has the nuget package. Please open issues if you see a problem. Thanks. |
@mjsabby has the update been published? I see commits as of 5 days ago but the last published Release is on 5/16/19 |
@mjsabby - thanks I see the updated Release and the new .vsix is posted there. Just so you know, only the 2.0 version is showing up in the VisualStudio Extension Manager. |
This might be caused by the discrepancy of PackageId between Marketplace and |
The .vsix downloaded from the latest release (3.0) still is listed as 2.0 after I uninstalled the old one and installed the one downloaded from the latest release. Maybe the version wasn't updated in the VS extension? |
@udlose It was. I may have kept it as 2.0 when uploading :( |
There are times I find myself returning an empty
List<T>
to satisfy the .Net Framework Design Guileine for return values representing a collection of some sort - https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/guidelines-for-collectionsUnfortunately, this creates an allocation that must be collected. Using
Enumerable.Empty<T>()
when only anIEnumerable<T>
is required will save an allocation since it is a Singleton and makes no allocation.It would be helpful to have a warning from this extension as a reminder to use the
Enumerable.Empty<T>()
Singleton.The text was updated successfully, but these errors were encountered: