From: Nicholas Clark Date: Thu, 15 Jul 2004 10:05:23 +0000 (+0000) Subject: Optimise for (reverse ...) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d46f46af75970be4ecf8811cc8d1ad9bcd7df36c;p=p5sagit%2Fp5-mst-13.2.git Optimise for (reverse ...) p4raw-id: //depot/perl@23114 --- diff --git a/op.c b/op.c index 23b12b7..e9ea2e5 100644 --- 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)