Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-02-12 04:57:57 +0300
committerJunio C Hamano <junkio@cox.net>2006-02-12 16:12:39 +0300
commit070879ca93a7d358086f4c8aff4553493dcb9210 (patch)
tree741a4ebdfc6cb5898c5229d9d2b78c03ad5aafc4 /fsck-objects.c
parent5b766ea9014b4121cb72f424633b6bf9a97308a0 (diff)
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 <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fsck-objects.c')
-rw-r--r--fsck-objects.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fsck-objects.c b/fsck-objects.c
index 9950be2645..6439d55126 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 */