diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-29 12:45:02 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-29 12:45:02 +0000 |
commit | af41f3ca4e00815b002eaf6169b8c9ab669f21b3 (patch) | |
tree | bf427f492d178365d3964c3fd1941efc2979e2c3 /op.c | |
parent | db173bac9b6de7d701a38c2f8b62f2fce229ec77 (diff) | |
download | perl-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.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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: |