Eliminate superfluous RV2p[AH]Vs in oops[AH]V()
Stephen McCamant [Sun, 2 Aug 1998 16:33:18 +0000 (11:33 -0500)]
Message-ID: <13764.55116.921952.837027@alias-2.pr.mcs.net>

p4raw-id: //depot/perl@1763

op.c

diff --git a/op.c b/op.c
index 3aac3bb..d72d313 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4055,7 +4055,7 @@ oopsAV(OP *o)
     case OP_PADSV:
        o->op_type = OP_PADAV;
        o->op_ppaddr = ppaddr[OP_PADAV];
-       return ref(newUNOP(OP_RV2AV, 0, scalar(o)), OP_RV2AV);
+       return ref(o, OP_RV2AV);
        
     case OP_RV2SV:
        o->op_type = OP_RV2AV;
@@ -4078,7 +4078,7 @@ oopsHV(OP *o)
     case OP_PADAV:
        o->op_type = OP_PADHV;
        o->op_ppaddr = ppaddr[OP_PADHV];
-       return ref(newUNOP(OP_RV2HV, 0, scalar(o)), OP_RV2HV);
+       return ref(o, OP_RV2HV);
 
     case OP_RV2SV:
     case OP_RV2AV:
@@ -5191,24 +5191,6 @@ peep(register OP *o)
            o->op_seq = PL_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: