This mimics the behaviour in Perl_hv_ksplit().
Also remove a vestigial comment. The code it relates to was removed in
commit
7dc8663964c66a69 in Nov 2012.
Zero(&a[oldsize * sizeof(HE*)], (newsize-oldsize) * sizeof(HE*), char); /* zero 2nd half*/
HvMAX(hv) = --newsize;
HvARRAY(hv) = (HE**) a;
- aep = (HE**)a;
+ if (!HvTOTALKEYS(hv)) /* skip rest if no entries */
+ return;
+
+ aep = (HE**)a;
for (i=0; i<oldsize; i++) {
HE **oentry = aep + i;
HE *entry = aep[i];
}
entry = *oentry;
} while (entry);
- /* I think we don't actually need to keep track of the longest length,
- merely flag if anything is too long. But for the moment while
- developing this code I'll track it. */
}
}