Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions csharp/Platform.Collections/ICollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;

#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
Expand Down Expand Up @@ -27,29 +26,5 @@ public static class ICollectionExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsNullOrEmpty<T>(this ICollection<T> collection) => collection == null || collection.Count == 0;

/// <summary>
/// <para>
/// Determines whether all equal to default.
/// </para>
/// <para></para>
/// </summary>
/// <typeparam name="T">
/// <para>The .</para>
/// <para></para>
/// </typeparam>
/// <param name="collection">
/// <para>The collection.</para>
/// <para></para>
/// </param>
/// <returns>
/// <para>The bool</para>
/// <para></para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool AllEqualToDefault<T>(this ICollection<T> collection)
{
var equalityComparer = EqualityComparer<T>.Default;
return collection.All(item => equalityComparer.Equals(item, default));
}
}
}
Loading