diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-23 12:52:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-23 12:52:55 -0700 |
commit | ba8e6326f16748d67fbeda65ffde4729760c64f0 (patch) | |
tree | cfd553f836c093db7d9f495127d972c688a398b0 /revision.c | |
parent | 58bbace89d3e94a20faae4df0d20d57574dff6e1 (diff) | |
parent | 7365c95d2d67cbbb74c2040918d2ecde06231d93 (diff) | |
download | git-ba8e6326f16748d67fbeda65ffde4729760c64f0.tar.gz |
Merge branch 'rs/commit-list-sort-in-batch'
Setting up a revision traversal with many starting points was inefficient
as these were placed in a date-order priority queue one-by-one.
By René Scharfe (3) and Junio C Hamano (1)
* rs/commit-list-sort-in-batch:
mergesort: rename it to llist_mergesort()
revision: insert unsorted, then sort in prepare_revision_walk()
commit: use mergesort() in commit_list_sort_by_date()
add mergesort() for linked lists
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/revision.c b/revision.c index b3554ed11b..92095f5fcb 100644 --- a/revision.c +++ b/revision.c @@ -2076,11 +2076,13 @@ int prepare_revision_walk(struct rev_info *revs) if (commit) { if (!(commit->object.flags & SEEN)) { commit->object.flags |= SEEN; - commit_list_insert_by_date(commit, &revs->commits); + commit_list_insert(commit, &revs->commits); } } e++; } + commit_list_reverse(&revs->commits); + commit_list_sort_by_date(&revs->commits); if (!revs->leak_pending) free(list); |