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/index.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/index.h')
-rw-r--r-- | src/index.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/index.h b/src/index.h index 658404953..f548c7b68 100644 --- a/src/index.h +++ b/src/index.h @@ -3,6 +3,7 @@ #include "fileops.h" #include "filelock.h" +#include "vector.h" #include "git/odb.h" #include "git/index.h" @@ -24,11 +25,8 @@ struct git_index { char *index_file_path; time_t last_modified; + git_vector entries; - git_index_entry *entries; - unsigned int entries_size; - - unsigned int entry_count; unsigned int sorted:1, on_disk:1; |