From: Malcolm Beattie Date: Wed, 29 Oct 1997 12:45:02 +0000 (+0000) Subject: Change peep() to optimise away unneeded rv2av in lval->[] and lval->{} X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=af41f3ca4e00815b002eaf6169b8c9ab669f21b3;p=p5sagit%2Fp5-mst-13.2.git Change peep() to optimise away unneeded rv2av in lval->[] and lval->{} p4raw-id: //depot/perl@187 --- diff --git a/op.c b/op.c index f9449f5..e7d843d 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: