pp_hot.c: Clean up after the prev commit
authorFather Chrysostomos <sprout@cpan.org>
Wed, 4 Jul 2012 19:51:31 +0000 (12:51 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 20 Sep 2012 16:49:33 +0000 (09:49 -0700)
Even before that it was more complicated than necessary, as
SvPV_nomg_const  never returns null.

pp_hot.c

index 7b71474..4100ae2 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2965,34 +2965,29 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
        ob = MUTABLE_SV(SvRV(sv));
     else if (!SvOK(sv)) goto undefined;
     else {
+       /* this isn't a reference */
        GV* iogv;
         STRLEN packlen;
-        const char * packname = NULL;
+        const char * const packname = SvPV_nomg_const(sv, packlen);
        bool packname_is_utf8 = FALSE;
-
-       /* this isn't a reference */
-        if(SvOK(sv) && (packname = SvPV_nomg_const(sv, packlen))) {
-          const HE* const he =
+        const HE* const he =
            (const HE *)hv_common_key_len(
              PL_stashcache, packname,
              packlen * -(packname_is_utf8 = !!SvUTF8(sv)), 0, NULL, 0
            );
          
-          if (he) { 
+        if (he) { 
             stash = INT2PTR(HV*,SvIV(HeVAL(he)));
             goto fetch;
-          }
         }
 
-       if (!SvOK(sv) ||
-           !(packname) ||
-           !(iogv = gv_fetchpvn_flags(
+       if (!(iogv = gv_fetchpvn_flags(
                packname, packlen, SVf_UTF8 * packname_is_utf8, SVt_PVIO
             )) ||
            !(ob=MUTABLE_SV(GvIO(iogv))))
        {
            /* this isn't the name of a filehandle either */
-           if (!packname || !packlen)
+           if (!packlen)
            {
                Perl_croak(aTHX_ "Can't call method \"%"SVf"\" "
                                 "without a package or object reference",