This layout, which goes back to
765f542df2 in 2002, I find a bit con-
fusing. The comments help. (Though rewriting it might be better.)
Granted, back in 2002 there wasn’t nearly as much code in any of
the branches.
and doing it now facilitates the COW check. */
(void)SvPOK_only(dstr);
+ /* This long and winding if statement is laid out like this:
+ if ( source cannot COW
+ && it is not swipable either (recording whether it is)
+ && we cannot COW here (full check)
+ ) {
+ just copy the string
+ }
+ else {
+ swipe or cow
+ }
+ */
if (
/* If we're already COW then this clause is not true, and if COW
is allowed then we drop down to the else and make dest COW