This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_scalar(): re-order a few switch cases
authorDavid Mitchell <davem@iabyn.com>
Tue, 28 May 2019 11:22:19 +0000 (12:22 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 24 Jun 2019 10:40:07 +0000 (11:40 +0100)
Just a cosmetic change.

op.c

diff --git a/op.c b/op.c
index 35cb99b..11f368d 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1838,6 +1838,14 @@ Perl_scalar(pTHX_ OP *o)
        }
        break;
 
+    /* the children of these ops are usually a list of statements,
+     * except the leaves, whose first child is a corresponding enter
+     */
+    case OP_SCOPE:
+    case OP_LINESEQ:
+    case OP_LIST:
+       kid = cLISTOPo->op_first;
+       goto do_kids;
     case OP_LEAVE:
     case OP_LEAVETRY:
        kid = cLISTOPo->op_first;
@@ -1857,11 +1865,6 @@ Perl_scalar(pTHX_ OP *o)
        }
        PL_curcop = &PL_compiling;
        break;
-    case OP_SCOPE:
-    case OP_LINESEQ:
-    case OP_LIST:
-       kid = cLISTOPo->op_first;
-       goto do_kids;
 
     case OP_SORT:
        Perl_ck_warner(aTHX_ packWARN(WARN_VOID), "Useless use of sort in scalar context");