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 /scope.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 'scope.c')
-rw-r--r-- | scope.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -1194,10 +1194,7 @@ Perl_leave_scope(pTHX_ I32 base) break; case SVt_PVCV: { - HEK *hek = - CvNAMED(sv) - ? CvNAME_HEK((CV *)sv) - : GvNAME_HEK(CvGV(sv)); + HEK *hek = CvGvNAME_HEK(sv); assert(hek); (void)share_hek_hek(hek); cv_undef((CV *)sv); @@ -1223,9 +1220,7 @@ Perl_leave_scope(pTHX_ I32 base) case SVt_PVHV: *svp = MUTABLE_SV(newHV()); break; case SVt_PVCV: { - HEK * const hek = CvNAMED(sv) - ? CvNAME_HEK((CV *)sv) - : GvNAME_HEK(CvGV(sv)); + HEK * const hek = CvGvNAME_HEK(sv); /* Create a stub */ *svp = newSV_type(SVt_PVCV); |