You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
450 B
18 lines
450 B
1 year ago
|
namespace StabilityMatrix.Core.Extensions;
|
||
1 year ago
|
|
||
|
public static class EnumerableExtensions
|
||
|
{
|
||
|
public static IEnumerable<(int, T)> Enumerate<T>(
|
||
|
this IEnumerable<T> items,
|
||
|
int start
|
||
|
) {
|
||
|
return items.Select((item, index) => (index + start, item));
|
||
|
}
|
||
|
|
||
|
public static IEnumerable<(int, T)> Enumerate<T>(
|
||
|
this IEnumerable<T> items
|
||
|
) {
|
||
|
return items.Select((item, index) => (index, item));
|
||
|
}
|
||
|
}
|