This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use more efficient sv_reftype_len() interface
authorYves Orton <demerphq@gmail.com>
Mon, 30 Aug 2010 17:05:27 +0000 (19:05 +0200)
committerYves Orton <demerphq@gmail.com>
Mon, 30 Aug 2010 17:09:28 +0000 (19:09 +0200)
pp.c

diff --git a/pp.c b/pp.c
index fcb7ff2..31614ed 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -559,6 +559,7 @@ PP(pp_ref)
     dVAR; dSP; dTARGET;
     const char *pv;
     SV * const sv = POPs;
+    STRLEN len;
 
     if (sv)
        SvGETMAGIC(sv);
@@ -566,8 +567,8 @@ PP(pp_ref)
     if (!sv || !SvROK(sv))
        RETPUSHNO;
 
-    pv = sv_reftype(SvRV(sv),TRUE);
-    PUSHp(pv, strlen(pv));
+    pv = sv_reftype_len(SvRV(sv),TRUE,&len);
+    PUSHp(pv, len);
     RETURN;
 }