summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-10-07 12:06:24 -0400
committerFather Chrysostomos <sprout@cpan.org>2012-10-07 12:15:50 -0700
commit9b566a5e96cd28514ff4e2339c71b85af321c91f (patch)
tree950ec9a340909628c960db808b46758e381efd1a /op.c
parent33971c01593943c682191c11172d3bab281d6dab (diff)
downloadperl-9b566a5e96cd28514ff4e2339c71b85af321c91f.tar.gz
Merge 2 gv_fetch* calls in Perl_newXS_len_flags
Merge a gv_fetchpvn and a gv_fetchpv. A strlen call is avoided in gv_fetchpv, and in Perl_newXS_len_flags shorter machine code because 2 different call destinations were merged to 1, and "GV_ADDMULTI | flags,SVt_PVCV" arguments are unconditionally executed and are not in a branch.
Diffstat (limited to 'op.c')
-rw-r--r--op.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/op.c b/op.c
index fa48148994..d3df75e294 100644
--- a/op.c
+++ b/op.c
@@ -7851,13 +7851,11 @@ Perl_newXS_len_flags(pTHX_ const char *name, STRLEN len,
PERL_ARGS_ASSERT_NEWXS_LEN_FLAGS;
{
- GV * const gv = name
- ? gv_fetchpvn(
- name,len,GV_ADDMULTI|flags,SVt_PVCV
- )
- : gv_fetchpv(
- (PL_curstash ? "__ANON__" : "__ANON__::__ANON__"),
- GV_ADDMULTI | flags, SVt_PVCV);
+ GV * const gv = gv_fetchpvn(
+ name ? name : PL_curstash ? "__ANON__" : "__ANON__::__ANON__",
+ name ? len : PL_curstash ? sizeof("__ANON__") - 1:
+ sizeof("__ANON__::__ANON__") - 1,
+ GV_ADDMULTI | flags, SVt_PVCV);
if (!subaddr)
Perl_croak(aTHX_ "panic: no address for '%s' in '%s'", name, filename);