Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var collection = Enumerable.Repeat<Comparison>(new Comparison(), 5).ToList();
var items = Enumerable.Range(0, collection.Count).Zip(collection, (a, b) => new { Index = a, Value = b });
foreach(var item in items)
{
DoSomething(item.Value, item.Index);
}
for(var i = 0; i < collection.Count; i++)
{
DoSomething(collection[i], i);
SoICan(collection[i])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment