summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-09-27 11:48:14 +0000
committerNicholas Clark <nick@ccl4.org>2021-10-11 11:30:25 +0000
commit9faee2eae78e645be21d3d1de656460e8ea20f60 (patch)
tree9a6c531b037827fdc672ddd27f6fee58c939d6ed /sv.c
parentcaf0b9e5682bde101a4ee56b69daee5f3362ad0e (diff)
downloadperl-9faee2eae78e645be21d3d1de656460e8ea20f60.tar.gz
Move variables in Perl_sv_clear() to a tighter scope.
These three variables don't hold their values between iterations of the while loop, so can be declared within it, to make this obvious.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index 1e6f3cad68..a8ccba073d 100644
--- a/sv.c
+++ b/sv.c
@@ -6631,9 +6631,6 @@ instead.
void
Perl_sv_clear(pTHX_ SV *const orig_sv)
{
- HV *stash;
- U32 type;
- const struct body_details *sv_type_details;
SV* iter_sv = NULL;
SV* next_sv = NULL;
SV *sv = orig_sv;
@@ -6647,8 +6644,9 @@ Perl_sv_clear(pTHX_ SV *const orig_sv)
* over to provide more SVs */
while (sv) {
-
- type = SvTYPE(sv);
+ U32 type = SvTYPE(sv);
+ const struct body_details *sv_type_details;
+ HV *stash;
assert(SvREFCNT(sv) == 0);
assert(SvTYPE(sv) != (svtype)SVTYPEMASK);