diff options
author | Russell Belfer <rb@github.com> | 2014-02-03 21:02:08 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-02-03 21:02:08 -0800 |
commit | 4075e060b45a73834a24684ed835d52f7176d58b (patch) | |
tree | 89c615474fec2a85c3e53edf699531a76c1e228f /src/revwalk.c | |
parent | 40e10630cfbdddd878a6347c1751092bab7f7a28 (diff) | |
download | libgit2-4075e060b45a73834a24684ed835d52f7176d58b.tar.gz |
Replace pqueue with code from hashsig heap
I accidentally wrote a separate priority queue implementation when
I was working on file rename detection as part of the file hash
signature calculation code. To simplify licensing terms, I just
adapted that to a general purpose priority queue and replace the
old priority queue implementation that was borrowed from elsewhere.
This also removes parts of the COPYING document that no longer
apply to libgit2.
Diffstat (limited to 'src/revwalk.c')
-rw-r--r-- | src/revwalk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/revwalk.c b/src/revwalk.c index c0a053211..d6dc10652 100644 --- a/src/revwalk.c +++ b/src/revwalk.c @@ -439,7 +439,8 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo) walk->commits = git_oidmap_alloc(); GITERR_CHECK_ALLOC(walk->commits); - if (git_pqueue_init(&walk->iterator_time, 8, git_commit_list_time_cmp) < 0 || + if (git_pqueue_init( + &walk->iterator_time, 0, 8, git_commit_list_time_cmp) < 0 || git_vector_init(&walk->twos, 4, NULL) < 0 || git_pool_init(&walk->commit_pool, 1, git_pool__suggest_items_per_page(COMMIT_ALLOC) * COMMIT_ALLOC) < 0) @@ -542,7 +543,7 @@ void git_revwalk_reset(git_revwalk *walk) commit->uninteresting = 0; }); - git_pqueue_clear(&walk->iterator_time); + git_pqueue_free(&walk->iterator_time); git_commit_list_free(&walk->iterator_topo); git_commit_list_free(&walk->iterator_rand); git_commit_list_free(&walk->iterator_reverse); |