summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-12-19 16:05:15 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-12-19 16:30:39 -0800
commit82334630454b4b4e55257e3bf48f998a8a2814a9 (patch)
treeb81f353fabe8a3000578973d00d833e9905430cc /op.h
parent54408af452c3b8791b74227d549ac4a2d660d916 (diff)
downloadperl-82334630454b4b4e55257e3bf48f998a8a2814a9.tar.gz
Use GIMME_V in preference to GIMME
GIMME_V is a simpler macro that results in smaller machine code. GIMME does not distinguish between scalar and void context. The two instances of GIMME == G_SCALAR that I changed (which used to match void context too, but no longer do) are in code paths unreachable in void context, so we don’t need to check for it.
Diffstat (limited to 'op.h')
-rw-r--r--op.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/op.h b/op.h
index 4bc44de521..2487ca72a8 100644
--- a/op.h
+++ b/op.h
@@ -150,12 +150,14 @@ Deprecated. Use C<GIMME_V> instead.
#define OPf_LIST OPf_WANT_LIST
#define OPf_KNOW OPf_WANT
-#define GIMME \
+#ifndef PERL_CORE
+# define GIMME \
(PL_op->op_flags & OPf_WANT \
? ((PL_op->op_flags & OPf_WANT) == OPf_WANT_LIST \
? G_ARRAY \
: G_SCALAR) \
: dowantarray())
+#endif
/* NOTE: OPp* flags are now auto-generated and defined in opcode.h,