Remove take while op(does not return first none matched item)

This commit is contained in:
ZaneYork 2020-06-03 11:43:13 +08:00
parent 6b4e52febb
commit 9b41397a01
1 changed files with 0 additions and 1 deletions

View File

@ -119,7 +119,6 @@ namespace StardewModdingAPI.Framework.ModLoading.Framework
return new Tuple<bool, Exception>(false, e.InnerException ?? e); return new Tuple<bool, Exception>(false, e.InnerException ?? e);
} }
}) })
.TakeWhile(tuple => tuple.Item2 == null) // Stop on any exception occurs
.Aggregate((tupleA, tupleB) => new Tuple<bool, Exception>(tupleA.Item1 | tupleB.Item1, tupleA.Item2 ?? tupleB.Item2)); // Aggregate result and exception .Aggregate((tupleA, tupleB) => new Tuple<bool, Exception>(tupleA.Item1 | tupleB.Item1, tupleA.Item2 ?? tupleB.Item2)); // Aggregate result and exception
if (aggregateResult.Item2 != null) if (aggregateResult.Item2 != null)
{ {