This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid recalculating sub name hash in util.c:get_db_sub
authorFather Chrysostomos <sprout@cpan.org>
Mon, 17 Feb 2014 02:07:17 +0000 (18:07 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 17 Feb 2014 02:07:17 +0000 (18:07 -0800)
util.c

diff --git a/util.c b/util.c
index 5541ac9..a5451c1 100644 (file)
--- a/util.c
+++ b/util.c
@@ -5272,9 +5272,8 @@ S_gv_has_usable_name(pTHX_ GV *gv)
     GV **gvp;
     return GvSTASH(gv)
        && HvENAME(GvSTASH(gv))
-       && (gvp = (GV **)hv_fetch(
-                       GvSTASH(gv), GvNAME(gv),
-                       GvNAMEUTF8(gv) ? -GvNAMELEN(gv) : GvNAMELEN(gv), 0
+       && (gvp = (GV **)hv_fetchhek(
+                       GvSTASH(gv), GvNAME_HEK(gv), 0
           ))
        && *gvp == gv;
 }