summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-08-27 10:36:17 +0200
committerPatrick Steinhardt <ps@pks.im>2019-08-27 10:48:26 +0200
commit699de9c5f107e1ae127b9a9f5518d29f8864dfbe (patch)
treebc50f935a7ffb536fd51f9e70718cedbf318c0c9 /src/iterator.c
parent9ca7a60e68d72d6e1da6eac519de48ecfca6d7f1 (diff)
downloadlibgit2-699de9c5f107e1ae127b9a9f5518d29f8864dfbe.tar.gz
iterator: remove duplicate memset
When allocating new tree iterator frames, we zero out the allocated memory twice. Remove one of the `memset` calls.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/iterator.c b/src/iterator.c
index e95aed70b..28ffddf6c 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -543,8 +543,6 @@ static int tree_iterator_frame_init(
new_frame = git_array_alloc(iter->frames);
GIT_ERROR_CHECK_ALLOC(new_frame);
- memset(new_frame, 0, sizeof(tree_iterator_frame));
-
if ((error = git_tree_dup(&dup, tree)) < 0)
goto done;
@@ -552,14 +550,14 @@ static int tree_iterator_frame_init(
new_frame->tree = dup;
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;
cmp = iterator__ignore_case(&iter->base) ?
tree_iterator_entry_sort_icase : NULL;
- if ((error = git_vector_init(
- &new_frame->entries, dup->entries.size, cmp)) < 0)
+ if ((error = git_vector_init(&new_frame->entries,
+ dup->entries.size, cmp)) < 0)
goto done;
git_array_foreach(dup->entries, i, tree_entry) {