summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicolas R <atoomic@cpan.org>2017-09-18 14:37:48 -0600
committerFather Chrysostomos <sprout@cpan.org>2017-09-21 07:07:49 -0700
commit79656330a0811b95642a8239e923166ada7fb0a0 (patch)
treef096cb3c9e14bfb87ea704d6c96027285aea6b12 /gv.c
parentbd588a132b9686974e12bf262d1ba6c885895122 (diff)
downloadperl-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.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index cfe4be572c..6df78cc013 100644
--- a/gv.c
+++ b/gv.c
@@ -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")