From 6bed2ed6638d89f883503ed1dbfdbff14aa4c3f3 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 30 Nov 2013 12:56:56 -0800 Subject: [PATCH] sv.c: Clarify COW comments further I was getting confused even when I wrote these comments. --- sv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sv.c b/sv.c index 362b977..ab3ffef 100644 --- a/sv.c +++ b/sv.c @@ -4324,9 +4324,10 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, SV* sstr, const I32 flags) (void)SvPOK_only(dstr); /* This long and winding if statement is laid out like this: - if ( source cannot COW + if ( source is not already a cow + (or has reached its cow refcnt limit) && it is not swipable either (recording whether it is) - && we cannot COW here (full check) + && either source or destination cannot be upgraded to a cow ) { just copy the string } -- 2.7.4