Skip to content

Commit 4059503

Browse files
Copilotstephentoub
andcommitted
Remove ICollection<TSource> check from Any() method
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent b01040b commit 4059503

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

  • src/libraries/System.Linq/src/System/Linq

src/libraries/System.Linq/src/System/Linq/AnyAll.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ public static bool Any<TSource>(this IEnumerable<TSource> source)
1515
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
1616
}
1717

18-
if (source is ICollection<TSource> gc)
19-
{
20-
return gc.Count != 0;
21-
}
22-
2318
if (!IsSizeOptimized && source is Iterator<TSource> iterator)
2419
{
2520
int count = iterator.GetCount(onlyIfCheap: true);

0 commit comments

Comments
 (0)