This may or may not be a problem, depending on your use case, since Any () will short-circuit as soon as the condition is met, which means that all IEnumerable does not need to be listed.
Check out the comments below, which indicate potential pitfalls, such as an implementation, just ahead or expensive.
Here's a reference source :
public static bool Any<TSource>(this IEnumerable<TSource> source) {
if (source == null) throw Error.ArgumentNull("source");
using (IEnumerator<TSource> e = source.GetEnumerator()) {
if (e.MoveNext()) return true;
}
return false;
}
source
share