Skip to content

Commit

Permalink
Remove dead code from Perl_gv_stashpvn().
Browse files Browse the repository at this point in the history
GvHV() and HvNAME() will both always already be set, as gv_fetchpvn_flags()
will initialise these as it walks the string in its initial loop to locate the
correct stash, then return early because name == name_end.

This code has been dead since it was added in 5.000.
  • Loading branch information
nwc10 committed Oct 8, 2010
1 parent 899de42 commit b4dd662
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gv.c
Expand Up @@ -927,11 +927,9 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 flags)
Safefree(tmpbuf);
if (!tmpgv)
return NULL;
if (!GvHV(tmpgv))
GvHV(tmpgv) = newHV();
stash = GvHV(tmpgv);
if (!HvNAME_get(stash))
hv_name_set(stash, name, namelen, 0);
assert(stash);
assert(HvNAME_get(stash));
return stash;
}

Expand Down

0 comments on commit b4dd662

Please sign in to comment.