This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "op.c: Don’t keep looping when we see potential common vars"
authorFather Chrysostomos <sprout@cpan.org>
Sun, 12 Oct 2014 18:22:49 +0000 (11:22 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 12 Oct 2014 18:22:49 +0000 (11:22 -0700)
This reverts commit bd2688c4c50527e5796ba4bc132c379f11e57112.

It seemed like an obvious optimisation, until it dawned on me that
this loop is doing two things, not just searching for common vars.

op.c

diff --git a/op.c b/op.c
index 1de26ae..7b8c176 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6072,10 +6072,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
                    lop->op_type == OP_PADHV ||
                    lop->op_type == OP_PADANY) {
                    if (!(lop->op_private & OPpLVAL_INTRO))
-                   {
                        maybe_common_vars = TRUE;
-                       break;
-                   }
 
                    if (lop->op_private & OPpPAD_STATE) {
                        if (left->op_private & OPpLVAL_INTRO) {
@@ -6097,7 +6094,6 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
                } else {
                    /* Other ops in the list. */
                    maybe_common_vars = TRUE;
-                   break;
                }
                lop = OP_SIBLING(lop);
            }