Skip to content

Instantly share code, notes, and snippets.

@moswald
Created May 13, 2014 17:39
Show Gist options
  • Save moswald/6f4da4540d4f1da316eb to your computer and use it in GitHub Desktop.
Save moswald/6f4da4540d4f1da316eb to your computer and use it in GitHub Desktop.
public static class ListMixins
{
public static IEnumerable<T> Forever<T>(this IList<T> This)
{
using (var e = This.GetEnumerator())
{
for (; ; )
{
while (e.MoveNext())
{
yield return e.Current;
}
e.Reset();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment