Commit 35168571 by Patrick Steinhardt

iterator: remove duplicate memset

When allocating new tree iterator frames, we zero out the allocated
memory twice. Remove one of the `memset` calls.
parent f647d021
...@@ -543,8 +543,6 @@ static int tree_iterator_frame_init( ...@@ -543,8 +543,6 @@ static int tree_iterator_frame_init(
new_frame = git_array_alloc(iter->frames); new_frame = git_array_alloc(iter->frames);
GIT_ERROR_CHECK_ALLOC(new_frame); GIT_ERROR_CHECK_ALLOC(new_frame);
memset(new_frame, 0, sizeof(tree_iterator_frame));
if ((error = git_tree_dup(&dup, tree)) < 0) if ((error = git_tree_dup(&dup, tree)) < 0)
goto done; goto done;
...@@ -552,14 +550,14 @@ static int tree_iterator_frame_init( ...@@ -552,14 +550,14 @@ static int tree_iterator_frame_init(
new_frame->tree = dup; new_frame->tree = dup;
if (frame_entry && if (frame_entry &&
(error = tree_iterator_compute_path(&new_frame->path, frame_entry)) < 0) (error = tree_iterator_compute_path(&new_frame->path, frame_entry)) < 0)
goto done; goto done;
cmp = iterator__ignore_case(&iter->base) ? cmp = iterator__ignore_case(&iter->base) ?
tree_iterator_entry_sort_icase : NULL; tree_iterator_entry_sort_icase : NULL;
if ((error = git_vector_init( if ((error = git_vector_init(&new_frame->entries,
&new_frame->entries, dup->entries.size, cmp)) < 0) dup->entries.size, cmp)) < 0)
goto done; goto done;
git_array_foreach(dup->entries, i, tree_entry) { git_array_foreach(dup->entries, i, tree_entry) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment