aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2007-11-02 13:32:58 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-04 01:54:20 -0700
commit23c17d4a4a0e1fc9a5fa347f1fc6be3cf477e543 (patch)
treec220a3c6a6e6cda4c6b0119e5a837823157cde12 /revision.c
parent140dd77a5cb2e61dcb942e245a2474fae95e42a5 (diff)
downloadgit-23c17d4a4a0e1fc9a5fa347f1fc6be3cf477e543.tar.gz
git-23c17d4a4a0e1fc9a5fa347f1fc6be3cf477e543.tar.xz
Simplify topo-sort logic
.. by not using quite so much indirection. This currently grows the "struct commit" a bit, which could be avoided by using a union for "util" and "indegree" (the topo-sort used to use "util" anyway, so you cannot use them together), but for now the goal of this was to simplify, not optimize. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/revision.c b/revision.c
index e76da0d44..e85b4af39 100644
--- a/revision.c
+++ b/revision.c
@@ -677,9 +677,6 @@ void init_revisions(struct rev_info *revs, const char *prefix)
revs->prune_fn = NULL;
revs->prune_data = NULL;
- revs->topo_setter = topo_sort_default_setter;
- revs->topo_getter = topo_sort_default_getter;
-
revs->commit_format = CMIT_FMT_DEFAULT;
diff_setup(&revs->diffopt);
@@ -1303,9 +1300,7 @@ int prepare_revision_walk(struct rev_info *revs)
if (limit_list(revs) < 0)
return -1;
if (revs->topo_order)
- sort_in_topological_order_fn(&revs->commits, revs->lifo,
- revs->topo_setter,
- revs->topo_getter);
+ sort_in_topological_order(&revs->commits, revs->lifo);
return 0;
}