summaryrefslogtreecommitdiff
path: root/scope.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 /scope.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 'scope.c')
-rw-r--r--scope.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/scope.c b/scope.c
index 59cea3b985..dfaab806aa 100644
--- a/scope.c
+++ b/scope.c
@@ -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);