diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-06-27 22:19:37 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-06-28 16:02:58 +0100 |
commit | a50a3493249ff7bef53bf1c83fa2c08468cc78cf (patch) | |
tree | 00a36d75f07b219eb26032659ee309c4ac174304 /hv.c | |
parent | 2d635dbfcbbec8b4f85ef7e32e26b482c38d4ee8 (diff) | |
download | perl-a50a3493249ff7bef53bf1c83fa2c08468cc78cf.tar.gz |
Move variable declarations inwards in S_hsplit() and Perl_hv_ksplit().
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1085,7 +1085,6 @@ S_hsplit(pTHX_ HV *hv) register I32 i; char *a = (char*) HvARRAY(hv); register HE **aep; - register HE **oentry; int longest_chain = 0; int was_shared; @@ -1142,13 +1141,14 @@ S_hsplit(pTHX_ HV *hv) for (i=0; i<oldsize; i++,aep++) { int left_length = 0; int right_length = 0; - register HE *entry; + HE **oentry = aep; + HE *entry = *aep; register HE **bep; - if (!*aep) /* non-existent */ + if (!entry) /* non-existent */ continue; bep = aep+oldsize; - for (oentry = aep, entry = *aep; entry; entry = *oentry) { + for (; entry; entry = *oentry) { if ((HeHASH(entry) & newsize) != (U32)i) { *oentry = HeNEXT(entry); HeNEXT(entry) = *bep; @@ -1250,8 +1250,6 @@ Perl_hv_ksplit(pTHX_ HV *hv, IV newmax) register I32 i; register char *a; register HE **aep; - register HE *entry; - register HE **oentry; PERL_ARGS_ASSERT_HV_KSPLIT; @@ -1311,9 +1309,12 @@ Perl_hv_ksplit(pTHX_ HV *hv, IV newmax) aep = (HE**)a; for (i=0; i<oldsize; i++,aep++) { - if (!*aep) /* non-existent */ + HE **oentry = aep; + HE *entry = *aep; + + if (!entry) /* non-existent */ continue; - for (oentry = aep, entry = *aep; entry; entry = *oentry) { + for (; entry; entry = *oentry) { register I32 j = (HeHASH(entry) & newsize); if (j != i) { |