To determine the where to place the split when repacking with the
'--geometric' option, split_pack_geometry() assigns the "split" variable
and then decrements it in a loop.
It would be equivalent (and more readable) to assign the split to the
loop position after exiting the loop, so do that instead.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
return;
}
- split = geometry->pack_nr - 1;
-
/*
* First, count the number of packs (in descending order of size) which
* already form a geometric progression.
for (i = geometry->pack_nr - 1; i > 0; i--) {
struct packed_git *ours = geometry->pack[i];
struct packed_git *prev = geometry->pack[i - 1];
- if (geometry_pack_weight(ours) >= factor * geometry_pack_weight(prev))
- split--;
- else
+ if (geometry_pack_weight(ours) < factor * geometry_pack_weight(prev))
break;
}
+ split = i;
+
if (split) {
/*
* Move the split one to the right, since the top element in the