Skip to content

Commit

Permalink
Refactor Storable's store_lhash() to remove some code duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
nwc10 committed Aug 30, 2021
1 parent ba8474b commit f934338
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dist/Storable/Storable.xs
Original file line number Diff line number Diff line change
Expand Up @@ -3170,12 +3170,11 @@ static int store_lhash(pTHX_ stcxt_t *cxt, HV *hv, unsigned char hash_flags)
array = HvARRAY(hv);
for (i = 0; i <= (Size_t)HvMAX(hv); i++) {
HE* entry = array[i];
if (!entry) continue;
if ((ret = store_hentry(aTHX_ cxt, hv, ix++, entry, hash_flags)))
return ret;
while ((entry = HeNEXT(entry))) {

while (entry) {
if ((ret = store_hentry(aTHX_ cxt, hv, ix++, entry, hash_flags)))
return ret;
entry = HeNEXT(entry);
}
}
if (recur_sv == (SV*)hv && cxt->max_recur_depth_hash != -1 && cxt->recur_depth > 0) {
Expand Down

0 comments on commit f934338

Please sign in to comment.