MutableArray Copy for corelib

Is it possible to expose a method in the gamma corelib that allows MutableArray to be copied to a new MutableArray? With offset and length? (Eg same functionality as GetSpread?)

There is already Array.CopyTo BUT this is only for immutable array.

Usecase is nugets and other external sources that force you to play with MutableArray.


Or is there some way to do this already with inherited base types? I couldn’t work it out.

I have these workarounds but I think they make an unnecessary copy because of the FromSequence node.

1

image

For reference It does seem like the Copy function is optimised versus iterating through the collection
c# - Is Array.Copy() faster than for loop, for 2D arrays? - Stack Overflow.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.