diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-07 14:57:36 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-07 14:57:36 +0000 |
commit | 789b4bc932459a2b438f46d8892d9c12f1afe8a1 (patch) | |
tree | 373d544af7955adf888b52b6225806a571ba4555 /pp.c | |
parent | 299476e067e522a02a8665fc1b3cd7f58f408de0 (diff) | |
download | perl-789b4bc932459a2b438f46d8892d9c12f1afe8a1.tar.gz |
pp_pop can be implemented by pp_shift.
p4raw-id: //depot/perl@27121
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -4195,24 +4195,12 @@ PP(pp_push) RETURN; } -PP(pp_pop) -{ - dVAR; - dSP; - AV * const av = (AV*)POPs; - SV * const sv = av_pop(av); - if (AvREAL(av)) - (void)sv_2mortal(sv); - PUSHs(sv); - RETURN; -} - PP(pp_shift) { dVAR; dSP; AV * const av = (AV*)POPs; - SV * const sv = av_shift(av); + SV * const sv = PL_op->op_type == OP_SHIFT ? av_shift(av) : av_pop(av); EXTEND(SP, 1); if (!sv) RETPUSHUNDEF; |