diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-12-02 04:31:54 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-12-02 04:31:54 +0200 |
commit | c4034e63f358cfed6bd851a831c50dbcd5006ffe (patch) | |
tree | 2417969470e0b1e8a65b928c711ab5dab34eb9c8 /src/tree.h | |
parent | 1e35f929ef0df0e28c14655fa47406732f30cc73 (diff) | |
download | libgit2-c4034e63f358cfed6bd851a831c50dbcd5006ffe.tar.gz |
Refactor all 'vector' functions into common code
All the operations on the 'git_index_entry' array and the
'git_tree_entry' array have been refactored into common code in the
src/vector.c file.
The new vector methods support:
- insertion: O(1) (avg)
- deletion: O(n)
- searching: O(logn)
- sorting: O(logn)
- r. access: O(1)
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/tree.h')
-rw-r--r-- | src/tree.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tree.h b/src/tree.h index db1c19ffe..84d02222f 100644 --- a/src/tree.h +++ b/src/tree.h @@ -3,6 +3,7 @@ #include <git/tree.h> #include "repository.h" +#include "vector.h" struct git_tree_entry { unsigned int attr; @@ -14,10 +15,7 @@ struct git_tree_entry { struct git_tree { git_object object; - - git_tree_entry **entries; - size_t entry_count; - size_t array_size; + git_vector entries; }; void git_tree__free(git_tree *tree); |