Convert db_get_cv() to use get_cvn_flags() as it already knows the length of
authorNicholas Clark <nick@ccl4.org>
Wed, 21 Jan 2009 17:06:14 +0000 (17:06 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 21 Jan 2009 17:09:11 +0000 (17:09 +0000)
the string that it is passing.

ext/Devel/DProf/DProf.xs

index ea36b24..4eef0bc 100644 (file)
@@ -24,7 +24,9 @@ db_get_cv(pTHX_ SV *sv)
            cv = INT2PTR(CV*,SvIVX(sv));
        } else {
            if (SvPOK(sv)) {
-               cv = get_cv(SvPVX_const(sv), GV_ADD);
+               STRLEN len;
+               const char *const name = SvPV(sv, len);
+               cv = get_cvn_flags(name, len, GV_ADD | SvUTF8(sv));
            } else if (SvROK(sv)) {
                cv = (CV*)SvRV(sv);
            } else {