Is Array.Copy safe when the source and destination are the same array?

Yes, it is safe. It is documented how the method should behave in this case:

If sourceArray and destinationArray overlap, this method behaves as if the original values of sourceArray were preserved in a temporary location before destinationArray is overwritten.

Leave a Comment