Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ForEachWithIndex<TKey>(this IEnumerable<TKey> list, Action<TKey, int> compute)
- {
- if (list == null)
- return;
- var rlist = list.ToList();
- int count = rlist.Count;
- for (int i = 0; i < count; i++)
- {
- compute(rlist[i], i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement