aboutsummaryrefslogtreecommitdiff
path: root/name-rev.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-02-12 02:57:57 +0100
committerJunio C Hamano <junkio@cox.net>2006-02-12 05:12:39 -0800
commit070879ca93a7d358086f4c8aff4553493dcb9210 (patch)
tree741a4ebdfc6cb5898c5229d9d2b78c03ad5aafc4 /name-rev.c
parent5b766ea9014b4121cb72f424633b6bf9a97308a0 (diff)
downloadgit-070879ca93a7d358086f4c8aff4553493dcb9210.tar.gz
git-070879ca93a7d358086f4c8aff4553493dcb9210.tar.xz
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 'name-rev.c')
-rw-r--r--name-rev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/name-rev.c b/name-rev.c
index bbadb91aa..0c3f54762 100644
--- a/name-rev.c
+++ b/name-rev.c
@@ -232,9 +232,10 @@ int main(int argc, char **argv)
} else if (all) {
int i;
- for (i = 0; i < nr_objs; i++)
- printf("%s %s\n", sha1_to_hex(objs[i]->sha1),
- get_rev_name(objs[i]));
+ for (i = 0; i < obj_allocs; i++)
+ if (objs[i])
+ printf("%s %s\n", sha1_to_hex(objs[i]->sha1),
+ get_rev_name(objs[i]));
} else
for ( ; revs; revs = revs->next)
printf("%s %s\n", revs->name, get_rev_name(revs->item));