convenience function to append contents of sourceArray to destinationArray

This commit is contained in:
Michael Becker 2020-04-10 13:46:53 -04:00
parent 5e45a6d912
commit 4f1271a89a
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -48,5 +48,11 @@ namespace MBS.Framework
if (array.Length - (start + length) > -1)
Array.Copy(old, start + length, array, start, array.Length - (start + length));
}
public static void Array_Append<T>(ref T[] destinationArray, T[] sourceArray)
{
int start = destinationArray.Length;
Array.Resize<T>(ref destinationArray, destinationArray.Length + sourceArray.Length);
Array.Copy(sourceArray, 0, destinationArray, start, sourceArray.Length);
}
}
}