summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-29 12:45:02 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-10-29 12:45:02 +0000
commitaf41f3ca4e00815b002eaf6169b8c9ab669f21b3 (patch)
treebf427f492d178365d3964c3fd1941efc2979e2c3 /op.c
parentdb173bac9b6de7d701a38c2f8b62f2fce229ec77 (diff)
downloadperl-af41f3ca4e00815b002eaf6169b8c9ab669f21b3.tar.gz
Change peep() to optimise away unneeded rv2av in lval->[] and lval->{}
p4raw-id: //depot/perl@187
Diffstat (limited to 'op.c')
-rw-r--r--op.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/op.c b/op.c
index f9449f50d1..e7d843dac8 100644
--- a/op.c
+++ b/op.c
@@ -4886,6 +4886,24 @@ register OP* o;
o->op_seq = op_seqmax++;
break;
+ case OP_PADAV:
+ if (o->op_next->op_type == OP_RV2AV
+ && (o->op_next->op_flags && OPf_REF))
+ {
+ null(o->op_next);
+ o->op_next = o->op_next->op_next;
+ }
+ break;
+
+ case OP_PADHV:
+ if (o->op_next->op_type == OP_RV2HV
+ && (o->op_next->op_flags && OPf_REF))
+ {
+ null(o->op_next);
+ o->op_next = o->op_next->op_next;
+ }
+ break;
+
case OP_MAPWHILE:
case OP_GREPWHILE:
case OP_AND: