summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorgfx <gfuji@cpan.org>2009-09-05 16:46:34 +0900
committerYves Orton <demerphq@gemini.(none)>2009-09-05 11:55:14 +0200
commit46ca9baca57195cba6c2018437d0622aab45fe78 (patch)
tree348af1462885e9dd0a4f78b4233fe7535811428f /perl.c
parent72df79cfe3e47a2c10d5ec5cec73128097bea176 (diff)
downloadperl-46ca9baca57195cba6c2018437d0622aab45fe78.tar.gz
call_method() uses newSVpvn_flags(), instead of sv_2mortal(newSVpv(...)), because newSVpvn_flags() is now optimized.
Signed-off-by: Yves Orton <demerphq@gemini.(none)>
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl.c b/perl.c
index 126de99dab..3c80c97251 100644
--- a/perl.c
+++ b/perl.c
@@ -2485,9 +2485,13 @@ Perl_call_method(pTHX_ const char *methname, I32 flags)
/* name of the subroutine */
/* See G_* flags in cop.h */
{
+ STRLEN len;
PERL_ARGS_ASSERT_CALL_METHOD;
- return call_sv(sv_2mortal(newSVpv(methname,0)), flags | G_METHOD);
+ len = strlen(methname);
+
+ /* XXX: sv_2mortal(newSVpvn_share(methname, len)) can be faster */
+ return call_sv(newSVpvn_flags(methname, len, SVs_TEMP), flags | G_METHOD);
}
/* May be called with any of a CV, a GV, or an SV containing the name. */