Last active
March 9, 2016 14:01
-
-
Save AndyPook/5a0089b344441aebcb3c to your computer and use it in GitHub Desktop.
Equivalent of Enumerable.Empty<T> but returns an ICollection<T> (an empty array)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Arrays | |
{ | |
public static T[] Empty<T>() { return EmptyArray<T>.Instance; } | |
} | |
public static class EmptyArray<T> | |
{ | |
public static readonly T[] Instance = new T[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment