This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add some comments to pp_concat
authorDavid Mitchell <davem@iabyn.com>
Sat, 3 Jul 2010 16:01:33 +0000 (17:01 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sat, 3 Jul 2010 16:01:33 +0000 (17:01 +0100)
make it clearer what type of concat each code branch handles

pp_hot.c

index 0e52921..6f48d5a 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -244,7 +244,7 @@ PP(pp_concat)
        rcopied = TRUE;
     }
 
-    if (TARG != left) {
+    if (TARG != left) { /* not $l .= $r */
         STRLEN llen;
         const char* const lpv = SvPV_nomg_const(left, llen);
        lbyte = !DO_UTF8(left);
@@ -254,9 +254,9 @@ PP(pp_concat)
        else
            SvUTF8_off(TARG);
     }
-    else { /* TARG == left */
+    else { /* $l .= $r */
        if (!SvOK(TARG)) {
-           if (left == right && ckWARN(WARN_UNINITIALIZED))
+           if (left == right && ckWARN(WARN_UNINITIALIZED)) /* $l .= $l */
                report_uninit(right);
            sv_setpvs(left, "");
        }
@@ -268,7 +268,7 @@ PP(pp_concat)
 
     if (!rcopied) {
        if (left == right)
-           /* $a.$a: do magic twice: tied might return different 2nd time */
+           /* $r.$r: do magic twice: tied might return different 2nd time */
            SvGETMAGIC(right);
        rpv = SvPV_nomg_const(right, rlen);
        rbyte = !DO_UTF8(right);