summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-02-26 22:39:52 +0000
committerDavid Mitchell <davem@iabyn.com>2014-02-27 16:16:18 +0000
commit89a18b40609cfdfc4af7414a628064c743b836bd (patch)
tree3a3593f6879db35470c84ea4af224ab860ed2777 /pp_hot.c
parent3f44dc817bc788142268d4c17f46269d4468fb57 (diff)
downloadperl-89a18b40609cfdfc4af7414a628064c743b836bd.tar.gz
pp_entersub(): simplify XSUB arg cleanup code
The code that reduces the returned XS args to 1 arg in scalar context was a bit messy. This makes it smaller, more comprehensible, with slighylu smaller object size.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 7397a91b99..552be61129 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2777,12 +2777,12 @@ try_autoload:
CvXSUB(cv)(aTHX_ cv);
/* Enforce some sanity in scalar context. */
- if (gimme == G_SCALAR && ++markix != PL_stack_sp - PL_stack_base ) {
- if (markix > PL_stack_sp - PL_stack_base)
- *(PL_stack_base + markix) = &PL_sv_undef;
- else
- *(PL_stack_base + markix) = *PL_stack_sp;
- PL_stack_sp = PL_stack_base + markix;
+ if (gimme == G_SCALAR) {
+ SV **svp = PL_stack_base + markix + 1;
+ if (svp != PL_stack_sp) {
+ *svp = svp > PL_stack_sp ? &PL_sv_undef : *PL_stack_sp;
+ PL_stack_sp = svp;
+ }
}
LEAVE;
return NORMAL;