forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmpty.cs
More file actions
21 lines (19 loc) · 652 Bytes
/
Copy pathEmpty.cs
File metadata and controls
21 lines (19 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace System.Collections.Generic
{
/// <summary>
/// Helper to provide empty instances with minimal allocation.
/// </summary>
internal static class Empty<T>
{
private static readonly T[] _emptyArray = new T[0];
/// <summary>
/// Returns a zero length array of type. Only allocates once per distinct type.
/// </summary>
public static T[] Array
{
get { return _emptyArray; }
}
}
}