summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-04 12:51:31 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-20 09:49:33 -0700
commit89269094eac2074a779834560b45a2b374322023 (patch)
treebce0c0a20bca870e9a2ac1f921c1b766cedfe8d2 /pp_hot.c
parent7156e69abfd37267e85105c6ec0c449ce4e41523 (diff)
downloadperl-89269094eac2074a779834560b45a2b374322023.tar.gz
pp_hot.c: Clean up after the prev commit
Even before that it was more complicated than necessary, as SvPV_nomg_const never returns null.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 7b71474e71..4100ae2449 100644
--- 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",