Skip to content

Commit 782b06d

Browse files
committed
Move GetArrayProvider extension method from Core to Common
1 parent b535764 commit 782b06d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Pooling/PoolingExtensions.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ public static class PoolingExtensions
66
{
77
#region Arrays
88

9+
/// <summary>
10+
/// Gets a <see cref="IArrayPoolProvider{T}"/> from the factory
11+
/// </summary>
12+
/// <param name="factory"></param>
13+
/// <typeparam name="T"></typeparam>
14+
/// <returns></returns>
15+
public static IArrayPoolProvider<T> GetArrayProvider<T>(this IPoolFactory factory) => factory.GetProvider<T[]>() as IArrayPoolProvider<T>;
16+
917
/// <summary>
1018
/// Copies the source array to a pooled array of the same type
1119
/// </summary>
@@ -65,6 +73,6 @@ public static T[] PooledCopy<T>(this IPoolFactory factory, T[] source, int offse
6573

6674
#endregion
6775

68-
76+
6977
}
7078
}

0 commit comments

Comments
 (0)