Skip to content

Instantly share code, notes, and snippets.

@gluschenko
Created March 16, 2015 21:50
Show Gist options
  • Save gluschenko/c7cee8716c7faf1088d5 to your computer and use it in GitHub Desktop.
Save gluschenko/c7cee8716c7faf1088d5 to your computer and use it in GitHub Desktop.
public static T[] Concat<T>(this T[] x, T[] y)
{
if (x == null) throw new ArgumentNullException("x");
if (y == null) throw new ArgumentNullException("y");
int oldLen = x.Length;
Array.Resize<T>(ref x, x.Length + y.Length);
Array.Copy(y, 0, x, oldLen, y.Length);
return x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment