Commit 247e3b43 by Edward Thomson

iterator: mandate `advance_over`

Since the three iterators implement `advance_over` differently,
mandate it and implement each.
parent 0ef0b71c
...@@ -1070,6 +1070,15 @@ static int tree_iterator_advance_into( ...@@ -1070,6 +1070,15 @@ static int tree_iterator_advance_into(
return tree_iterator_advance(out, i); return tree_iterator_advance(out, i);
} }
static int tree_iterator_advance_over(
const git_index_entry **out,
git_iterator_status_t *status,
git_iterator *i)
{
*status = GIT_ITERATOR_STATUS_NORMAL;
return git_iterator_advance(out, i);
}
static void tree_iterator_clear(tree_iterator *iter) static void tree_iterator_clear(tree_iterator *iter)
{ {
while (iter->frames.size) while (iter->frames.size)
...@@ -1143,7 +1152,7 @@ int git_iterator_for_tree( ...@@ -1143,7 +1152,7 @@ int git_iterator_for_tree(
tree_iterator_current, tree_iterator_current,
tree_iterator_advance, tree_iterator_advance,
tree_iterator_advance_into, tree_iterator_advance_into,
NULL, /* advance_over */ tree_iterator_advance_over,
tree_iterator_reset, tree_iterator_reset,
tree_iterator_reset_range, tree_iterator_reset_range,
tree_iterator_at_end, tree_iterator_at_end,
......
...@@ -217,11 +217,7 @@ GIT_INLINE(int) git_iterator_advance_over( ...@@ -217,11 +217,7 @@ GIT_INLINE(int) git_iterator_advance_over(
git_iterator_status_t *status, git_iterator_status_t *status,
git_iterator *iter) git_iterator *iter)
{ {
if (iter->cb->advance_over) return iter->cb->advance_over(entry, status, iter);
return iter->cb->advance_over(entry, status, iter);
*status = GIT_ITERATOR_STATUS_NORMAL;
return git_iterator_advance(entry, iter);
} }
/** /**
......
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