Skip to content

Commit f869bed

Browse files
committed
Add the 'EmptyRefs' helper, to support Array.Empty on .NET 4.5
1 parent c814877 commit f869bed

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
3+
namespace ICSharpCode.SharpZipLib.Core
4+
{
5+
internal static class Empty
6+
{
7+
#if NET45
8+
internal static class EmptyArray<T>
9+
{
10+
public static readonly T[] Value = new T[0];
11+
}
12+
public static T[] Array<T>() => EmptyArray<T>.Value;
13+
#else
14+
public static T[] Array<T>() => System.Array.Empty<T>();
15+
#endif
16+
}
17+
}

0 commit comments

Comments
 (0)