From 57059091fad25427bce9b3d47e073ce0518d164b Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Mon, 9 Apr 2007 01:06:28 -0400 Subject: get rid of num_packed_objects() The coming index format change doesn't allow for the number of objects to be determined from the size of the index file directly. Instead, Let's initialize a field in the packed_git structure with the object count when the index is validated since the count is always known at that point. While at it let's reorder some struct packed_git fields to avoid padding due to needed 64-bit alignment for some of them. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- pack-check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pack-check.c') diff --git a/pack-check.c b/pack-check.c index f58083d11..d04536bbf 100644 --- a/pack-check.c +++ b/pack-check.c @@ -40,7 +40,7 @@ static int verify_packfile(struct packed_git *p, * have verified that nr_objects matches between idx and pack, * we do not do scan-streaming check on the pack file. */ - nr_objects = num_packed_objects(p); + nr_objects = p->num_objects; for (i = 0, err = 0; i < nr_objects; i++) { const unsigned char *sha1; void *data; @@ -79,7 +79,7 @@ static void show_pack_info(struct packed_git *p) { uint32_t nr_objects, i, chain_histogram[MAX_CHAIN]; - nr_objects = num_packed_objects(p); + nr_objects = p->num_objects; memset(chain_histogram, 0, sizeof(chain_histogram)); for (i = 0; i < nr_objects; i++) { -- cgit v1.2.1