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:
parent
8c24d6eb76
commit
6fb2757739
22
osu.Game/Extensions/CollectionExtensions.cs
Normal file
22
osu.Game/Extensions/CollectionExtensions.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user