mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
Remove custom ToArray extension
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// TODO: @bond Remove
|
||||
namespace MediaBrowser.Model.Extensions
|
||||
{
|
||||
// MoreLINQ - Extensions to LINQ to Objects
|
||||
@@ -42,19 +43,6 @@ namespace MediaBrowser.Model.Extensions
|
||||
return source.DistinctBy(keySelector, null);
|
||||
}
|
||||
|
||||
public static TSource[] ToArray<TSource>(this IEnumerable<TSource> source, int count)
|
||||
{
|
||||
if (source == null) throw new ArgumentNullException("source");
|
||||
if (count < 0) throw new ArgumentOutOfRangeException("count");
|
||||
var array = new TSource[count];
|
||||
int i = 0;
|
||||
foreach (var item in source)
|
||||
{
|
||||
array[i++] = item;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all distinct elements of the given source, where "distinctness"
|
||||
/// is determined via a projection and the specified comparer for the projected type.
|
||||
|
||||
Reference in New Issue
Block a user