Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 4b4b862

Browse files
committed
Merge pull request #2113 from James-Ko/patch-2
Simplify Any<TSource>() boolean logic
2 parents 3c1cc3a + 4579f9c commit 4b4b862

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/System.Linq/src/System/Linq/Enumerable.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,9 +1425,8 @@ public static bool Any<TSource>(this IEnumerable<TSource> source)
14251425
if (source == null) throw Error.ArgumentNull("source");
14261426
using (IEnumerator<TSource> e = source.GetEnumerator())
14271427
{
1428-
if (e.MoveNext()) return true;
1428+
return e.MoveNext();
14291429
}
1430-
return false;
14311430
}
14321431

14331432
public static bool Any<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)

0 commit comments

Comments
 (0)