summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-01-13 18:21:19 +0000
committerNicholas Clark <nick@ccl4.org>2007-01-13 18:21:19 +0000
commitfd7de8a8466b26f91b016c44f0d429fd3725d9d0 (patch)
tree98101742fcf1e096263fc11c33a5d047243b4baf /hv.c
parentf092b1f439150f5289d0fefd6e8b21c60fa0a54b (diff)
downloadperl-fd7de8a8466b26f91b016c44f0d429fd3725d9d0.tar.gz
In S_hfreeentries, orig_array can be const.
p4raw-id: //depot/perl@29790
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hv.c b/hv.c
index fb597e3f1c..bc1e305fdf 100644
--- a/hv.c
+++ b/hv.c
@@ -1697,11 +1697,11 @@ STATIC void
S_hfreeentries(pTHX_ HV *hv)
{
/* This is the array that we're going to restore */
- HE **orig_array;
+ HE **const orig_array = HvARRAY(hv);
HEK *name;
int attempts = 100;
- if (!HvARRAY(hv))
+ if (!orig_array)
return;
if (SvOOK(hv)) {
@@ -1715,7 +1715,6 @@ S_hfreeentries(pTHX_ HV *hv)
name = NULL;
}
- orig_array = HvARRAY(hv);
/* orig_array remains unchanged throughout the loop. If after freeing all
the entries it turns out that one of the little blighters has triggered
an action that has caused HvARRAY to be re-allocated, then we set