The comment states that data is duplicated in the square, but it's not. It would copy if the line did a copy rather than assigning, which only copies pointers to slices, rather than actual bytes in those slices.
As discussed with @adlerjohn in sync, the PR that was supposed to introduce the duplication but did not, in fact, achieve the goal and benchmark improvements there come from reduced allocations in other code parts.
The comment states that data is duplicated in the square, but it's not. It would copy if the line did a
copyrather than assigning, which only copies pointers to slices, rather than actual bytes in those slices.As discussed with @adlerjohn in sync, the PR that was supposed to introduce the duplication but did not, in fact, achieve the goal and benchmark improvements there come from reduced allocations in other code parts.