Commit 9eb9e5fa by Edward Thomson

iterator: cleanups

Remove some unused functions, refactor some ugliness.
parent d712c2b2
...@@ -1229,9 +1229,8 @@ int git_diff__from_iterators( ...@@ -1229,9 +1229,8 @@ int git_diff__from_iterators(
/* make iterators have matching icase behavior */ /* make iterators have matching icase behavior */
if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE)) { if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE)) {
if ((error = git_iterator_set_ignore_case(old_iter, true)) < 0 || git_iterator_set_ignore_case(old_iter, true);
(error = git_iterator_set_ignore_case(new_iter, true)) < 0) git_iterator_set_ignore_case(new_iter, true);
goto cleanup;
} }
/* finish initialization */ /* finish initialization */
......
...@@ -69,8 +69,6 @@ typedef struct { ...@@ -69,8 +69,6 @@ typedef struct {
int (*advance_over)( int (*advance_over)(
const git_index_entry **, git_iterator_status_t *, git_iterator *); const git_index_entry **, git_iterator_status_t *, git_iterator *);
int (*reset)(git_iterator *); int (*reset)(git_iterator *);
int (*reset_range)(git_iterator *, const char *start, const char *end);
int (*at_end)(git_iterator *);
void (*free)(git_iterator *); void (*free)(git_iterator *);
} git_iterator_callbacks; } git_iterator_callbacks;
...@@ -232,21 +230,8 @@ GIT_INLINE(int) git_iterator_reset(git_iterator *iter) ...@@ -232,21 +230,8 @@ GIT_INLINE(int) git_iterator_reset(git_iterator *iter)
* Go back to the start of the iteration after updating the `start` and * Go back to the start of the iteration after updating the `start` and
* `end` pathname boundaries of the iteration. * `end` pathname boundaries of the iteration.
*/ */
GIT_INLINE(int) git_iterator_reset_range( extern int git_iterator_reset_range(
git_iterator *iter, const char *start, const char *end) git_iterator *iter, const char *start, const char *end);
{
return iter->cb->reset_range(iter, start, end);
}
/**
* Check if the iterator is at the end
*
* @return 0 if not at end, >0 if at end
*/
GIT_INLINE(int) git_iterator_at_end(git_iterator *iter)
{
return iter->cb->at_end(iter);
}
GIT_INLINE(git_iterator_type_t) git_iterator_type(git_iterator *iter) GIT_INLINE(git_iterator_type_t) git_iterator_type(git_iterator *iter)
{ {
...@@ -273,7 +258,8 @@ GIT_INLINE(bool) git_iterator_ignore_case(git_iterator *iter) ...@@ -273,7 +258,8 @@ GIT_INLINE(bool) git_iterator_ignore_case(git_iterator *iter)
return ((iter->flags & GIT_ITERATOR_IGNORE_CASE) != 0); return ((iter->flags & GIT_ITERATOR_IGNORE_CASE) != 0);
} }
extern int git_iterator_set_ignore_case(git_iterator *iter, bool ignore_case); extern void git_iterator_set_ignore_case(
git_iterator *iter, bool ignore_case);
extern int git_iterator_current_tree_entry( extern int git_iterator_current_tree_entry(
const git_tree_entry **entry_out, git_iterator *iter); const git_tree_entry **entry_out, git_iterator *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