Skip to content

Commit

Permalink
Add first or default
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Jan 12, 2024
1 parent 4506e62 commit 0403e57
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FactorioTools/AllowedLinq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public static TSource First<TSource>(this IEnumerable<TSource> source, Func<TSou
return Enumerable.First(source, predicate);
}

public static TSource? FirstOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
{
return Enumerable.FirstOrDefault(source, predicate);
}

public static double Average<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector)
{
return Enumerable.Average(source, selector);
Expand Down

0 comments on commit 0403e57

Please sign in to comment.