1
0
Fork 0
mirror of https://github.com/wagesj45/mdfinder.git synced 2025-09-09 03:20:38 -05:00

Period Checkin

This commit is contained in:
Jordan Wages 2019-02-21 17:03:40 -06:00
commit be05120bdb
28 changed files with 1541 additions and 42 deletions

View file

@ -27,5 +27,20 @@ namespace mdfinder
.GroupBy(a => a.i / binSize)
.Select(grp => grp.Select(a => a.x));
}
/// <summary> An IEnumerable<T> extension method that returns the first item or a given default value if no items are in the collection. </summary>
/// <typeparam name="T"> Generic type parameter. </typeparam>
/// <param name="items"> The items to act on. </param>
/// <param name="default"> The default. </param>
/// <returns> A T. </returns>
public static T FirstOr<T>(this IEnumerable<T> items, T @default)
{
foreach(var t in items)
{
return t;
}
return @default;
}
}
}