diff options
author | Vicent Marti <tanoku@gmail.com> | 2015-10-27 17:26:04 +0100 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2015-10-28 10:13:13 +0100 |
commit | 1e5e02b4f47779fe3733b1a6ab24a6ca13099ec3 (patch) | |
tree | ac854971d3609c9065cbaee0119541428bdc9477 /src/iterator.c | |
parent | efc659b071e02c6d3b39b32b35ab83233d978956 (diff) | |
download | libgit2-1e5e02b4f47779fe3733b1a6ab24a6ca13099ec3.tar.gz |
pool: Simplify implementation
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/iterator.c b/src/iterator.c index e3a2abf66..ee348de6e 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -567,7 +567,7 @@ static bool tree_iterator__pop_frame(tree_iterator *ti, bool final) tree_iterator__move_to_next(ti, tf); if (!final) { /* if final, don't bother to clean up */ - git_pool_free_array(&ti->pool, tf->n_entries, (void **)tf->entries); + // TODO: maybe free the pool so far? git_buf_rtruncate_at_char(&ti->path, '/'); } @@ -822,8 +822,9 @@ int git_iterator_for_tree( if ((error = iterator__update_ignore_case((git_iterator *)ti, options ? options->flags : 0)) < 0) goto fail; - if ((error = git_pool_init(&ti->pool, sizeof(tree_iterator_entry),0)) < 0 || - (error = tree_iterator__create_root_frame(ti, tree)) < 0 || + git_pool_init(&ti->pool, sizeof(tree_iterator_entry)); + + if ((error = tree_iterator__create_root_frame(ti, tree)) < 0 || (error = tree_iterator__push_frame(ti)) < 0) /* expand root now */ goto fail; |