On Thursday, 3 April 2014 at 07:03:26 UTC, dnspies wrote:
If two dynamic arrays point to the same place in memory, is it
fast to compare them for equality? or does every element still
have to be compared?
Depends how you test for equality.
If you use "is", the "opEquals" will straight up check that the
slices are the actual same slice (point to same memory, same
length).
If you use "==" or "[] == []" (which is equivalent), then it will
check the lengths, then the pointers, and finally, the elements.