Skip to content

Instantly share code, notes, and snippets.

@jamesmanning
Created March 4, 2012 19:17
Show Gist options
  • Save jamesmanning/1974417 to your computer and use it in GitHub Desktop.
Save jamesmanning/1974417 to your computer and use it in GitHub Desktop.
Existing ToArray declarion in Enumerable
public static TSource[] ToArray<TSource>(this IEnumerable<TSource> source)
{
if (source != null)
{
Buffer<TSource> buffer = new Buffer<TSource>(source);
return buffer.ToArray();
}
else
{
throw Error.ArgumentNull("source");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment