1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 03:22:57 +08:00

Remove usage of Nuget.Packaging extension methods for IList.AddRange

This commit is contained in:
Dean Herbert 2021-11-23 14:58:18 +09:00
parent 8c24d6eb76
commit 6fb2757739
3 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1,22 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
namespace osu.Game.Extensions
{
public static class CollectionExtensions
{
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items)
{
// List<T> has a potentially more optimal path to adding a range.
if (collection is List<T> list)
list.AddRange(items);
else
{
foreach (T obj in items)
collection.Add(obj);
}
}
}
}

View File

@ -7,7 +7,6 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NuGet.Packaging;
using osu.Framework.Audio.Track;
using osu.Framework.Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;

View File

@ -8,7 +8,6 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Humanizer;
using NuGet.Packaging;
using osu.Framework.Extensions;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Logging;