Optimise for (reverse ...)
Nicholas Clark [Thu, 15 Jul 2004 10:05:23 +0000 (10:05 +0000)]
p4raw-id: //depot/perl@23114

op.c

diff --git a/op.c b/op.c
index 23b12b7..e9ea2e5 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6732,17 +6732,18 @@ Perl_peep(pTHX_ register OP *o)
                if (!enter)
                    break;
            }
-           /* for $a (...) will have OP_GV then OP_RV2GV here.  */
+           /* for $a (...) will have OP_GV then OP_RV2GV here.
+              for (...) just has an OP_GV.  */
            if (enter->op_type == OP_GV) {
                gvop = (OP *) enter;
                enter = (LISTOP *) enter->op_next;
                if (!enter)
                    break;
-               if (enter->op_type != OP_RV2GV)
-                   break;
-               enter = (LISTOP *) enter->op_next;
-               if (!enter)
+               if (enter->op_type == OP_RV2GV) {
+                 enter = (LISTOP *) enter->op_next;
+                 if (!enter)
                    break;
+               }
            }
 
            if (enter->op_type != OP_ENTERITER)