From: Nicolas Pitre Date: Mon, 16 Apr 2007 16:28:52 +0000 (-0400) Subject: pack-objects: equal objects in size should delta against newer objects X-Git-Tag: v1.5.2-rc0~20^2~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/adcc70950e594065050c375ace8a039678d2e31f?hp=--cc pack-objects: equal objects in size should delta against newer objects Before finding best delta combinations, we sort objects by name hash, then by size, then by their position in memory. Then we walk the list backwards to test delta candidates. We hope that a bigger size usually means a newer objects. But a bigger address in memory does not mean a newer object. So the last comparison must be reversed. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- adcc70950e594065050c375ace8a039678d2e31f diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 62a011e2e9..869ca1ab26 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -1276,7 +1276,7 @@ static int type_size_sort(const struct object_entry *a, const struct object_entr return -1; if (a->size > b->size) return 1; - return a < b ? -1 : (a > b); + return a > b ? -1 : (a < b); /* newest last */ } struct unpacked {