completed the branch
This commit is contained in:
1 parent
958cda81a7
commit
e2f24256f6
7 files changed
+153
-20
No files matched your search
@@ -16,5 +16,16 @@ namespace HandyControl.Tools.Extension
|
||||
|
||||
return enumerable;
|
||||
}
|
||||
|
||||
public static IEnumerable<TSource> DoWithIndex<TSource>(this IEnumerable<TSource> source, Action<TSource, int> predicate)
|
||||
{
|
||||
var enumerable = source as IList<TSource> ?? source.ToList();
|
||||
for (var i = 0; i < enumerable.Count; i++)
|
||||
{
|
||||
predicate.Invoke(enumerable[i], i);
|
||||
}
|
||||
|
||||
return enumerable;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user