Optimise LinqBridge Any

This commit is contained in:
Jon Hanna
2017-01-04 15:45:06 +00:00
parent dbc7374995
commit 32d8b4a68a
+9 -1
View File
@@ -1246,7 +1246,15 @@ namespace Newtonsoft.Json.Utilities.LinqBridge
this IEnumerable<TSource> source,
Func<TSource, bool> predicate)
{
return source.Where(predicate).Any();
foreach (TSource item in source)
{
if (predicate(item))
{
return true;
}
}
return false;
}
/// <summary>