From 070879ca93a7d358086f4c8aff4553493dcb9210 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 12 Feb 2006 02:57:57 +0100 Subject: Use a hashtable for objects instead of a sorted list In a simple test, this brings down the CPU time from 47 sec to 22 sec. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- fsck-objects.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fsck-objects.c') diff --git a/fsck-objects.c b/fsck-objects.c index 9950be264..6439d5512 100644 --- a/fsck-objects.c +++ b/fsck-objects.c @@ -61,9 +61,12 @@ static void check_connectivity(void) int i; /* Look up all the requirements, warn about missing objects.. */ - for (i = 0; i < nr_objs; i++) { + for (i = 0; i < obj_allocs; i++) { struct object *obj = objs[i]; + if (!obj) + continue; + if (!obj->parsed) { if (!standalone && has_sha1_file(obj->sha1)) ; /* it is in pack */ -- cgit v1.2.1