Extremely fast way to clone the values of a jagged array into a second array?

前端 未结 4 1437
青春惊慌失措
青春惊慌失措 2020-12-09 05:28

I am currently working on an application that is responsible for calculating random permutations of a jagged array.

Currently the bulk of the time in the applicati

4条回答
  •  青春惊慌失措
    2020-12-09 06:14

    The faster way to copy objects is not to copy them at all - have you considered this option? If you just need to generate permutations you don't need to copy data on each one - just change the array. This approach will not work well if you need to keep on results of previous calls. In any case review your code to see if you are not copying data more times that you have to.

提交回复
热议问题