04-23-2014 06:25 PM
I have an array that is 72 rows (32 channels, 8 channels, 32 channels). I am trying to take the middle 8 channels and move to the end so it will be 32, 32, 8. I could delete a subset from the array then append to the end but I think that would cause 2 allocations. Was wondering if there was a more clean, inplace way of doing this?
Solved! Go to Solution.
04-23-2014 06:46 PM
Take 2 array subsets (32,8) (40,24) and then do two replacements into the original array (indices 64 and 32). I find it is typically twice as fast as delete + rebuild (cleanest looking), which is twice as fast as the IPES (slowest and ugliest by far). Your mileage may vary. It is all microseconds at that array size.
04-23-2014 11:39 PM
Thanks Darin. Yes, it wasn't so much a matter of efficiency in this case, but general best practice.