diff options
author | Russell Belfer <rb@github.com> | 2012-11-13 14:02:59 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-11-14 22:55:40 -0800 |
commit | bad68c0a998116685ad75cab84210004dd2c5be1 (patch) | |
tree | d8b6db9be06ea1fcc150b5a7d2ba4cd635a174aa /src/vector.h | |
parent | 5735bf5e6ab4da347b601d4b85c09c5c701dc002 (diff) | |
download | libgit2-bad68c0a998116685ad75cab84210004dd2c5be1.tar.gz |
Add iterator for git_index object
The index iterator could previously only be created from a repo
object, but this allows creating an iterator from a `git_index`
object instead (while keeping, though renaming, the old function).
Diffstat (limited to 'src/vector.h')
-rw-r--r-- | src/vector.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h index 5061f7846..6d820b8fc 100644 --- a/src/vector.h +++ b/src/vector.h @@ -29,17 +29,26 @@ void git_vector_swap(git_vector *a, git_vector *b); void git_vector_sort(git_vector *v); +/** Linear search for matching entry using internal comparison function */ int git_vector_search(git_vector *v, const void *entry); + +/** Linear search for matching entry using explicit comparison function */ int git_vector_search2(git_vector *v, git_vector_cmp cmp, const void *key); +/** + * Binary search for matching entry using explicit comparison function that + * returns position where item would go if not found. + */ int git_vector_bsearch3( unsigned int *at_pos, git_vector *v, git_vector_cmp cmp, const void *key); +/** Binary search for matching entry using internal comparison function */ GIT_INLINE(int) git_vector_bsearch(git_vector *v, const void *key) { return git_vector_bsearch3(NULL, v, v->_cmp, key); } +/** Binary search for matching entry using explicit comparison function */ GIT_INLINE(int) git_vector_bsearch2( git_vector *v, git_vector_cmp cmp, const void *key) { |