summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-07 14:57:36 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-07 14:57:36 +0000
commit789b4bc932459a2b438f46d8892d9c12f1afe8a1 (patch)
tree373d544af7955adf888b52b6225806a571ba4555 /pp.c
parent299476e067e522a02a8665fc1b3cd7f58f408de0 (diff)
downloadperl-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.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/pp.c b/pp.c
index 7789120e62..1a82a16bbf 100644
--- a/pp.c
+++ b/pp.c
@@ -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;