diff options
author | Nicolas R <atoomic@cpan.org> | 2017-09-18 14:37:48 -0600 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2017-09-21 07:07:49 -0700 |
commit | 79656330a0811b95642a8239e923166ada7fb0a0 (patch) | |
tree | f096cb3c9e14bfb87ea704d6c96027285aea6b12 /gv.c | |
parent | bd588a132b9686974e12bf262d1ba6c885895122 (diff) | |
download | perl-79656330a0811b95642a8239e923166ada7fb0a0.tar.gz |
Add CvGvNAME_HEK helper
CvGvNAME_HEK can be used instead of the boilerplate:
CvNAMED(sv) ? CvNAME_HEK((CV *)sv) : GvNAME_HEK(CvGV(sv))
This is also saving an extra CvNAMED check from CvNAME_HEK.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -2799,8 +2799,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash, bool destructing) gv = Perl_gv_fetchmeth_pvn(aTHX_ stash, cooky, l, -1, 0); cv = 0; if (gv && (cv = GvCV(gv)) && CvHASGV(cv)) { - const HEK * const gvhek = - CvNAMED(cv) ? CvNAME_HEK(cv) : GvNAME_HEK(CvGV(cv)); + const HEK * const gvhek = CvGvNAME_HEK(cv); const HEK * const stashek = HvNAME_HEK(CvNAMED(cv) ? CvSTASH(cv) : GvSTASH(CvGV(cv))); if (HEK_LEN(gvhek) == 3 && strEQ(HEK_KEY(gvhek), "nil") |