Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-01-09 01:39:15 +0400
committerRussell Belfer <rb@github.com>2013-01-15 21:49:32 +0400
commit4b181037553601a0747ad39ccdd85ebd3b184055 (patch)
tree1f4bb97ad79bd9f86337d372317e68f862fa1b3c /src/iterator.c
parentfacc0650b12655c9637732bb992d1053cd946057 (diff)
Minor iterator API cleanups
In preparation for further iterator changes, this cleans up a few small things in the iterator API: * removed the git_iterator_for_repo_index_range API * made git_iterator_free not be inlined * minor param name and test function name tweaks
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 08e2e79e4..3d75dd8b5 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -485,20 +485,6 @@ int git_iterator_for_index_range(
return 0;
}
-int git_iterator_for_repo_index_range(
- git_iterator **iter,
- git_repository *repo,
- const char *start,
- const char *end)
-{
- int error;
- git_index *index;
-
- if ((error = git_repository_index__weakptr(&index, repo)) < 0)
- return error;
-
- return git_iterator_for_index_range(iter, index, start, end);
-}
typedef struct workdir_iterator_frame workdir_iterator_frame;
struct workdir_iterator_frame {
@@ -988,6 +974,22 @@ fail:
return -1;
}
+
+void git_iterator_free(git_iterator *iter)
+{
+ if (iter == NULL)
+ return;
+
+ iter->cb->free(iter);
+
+ git__free(iter->start);
+ git__free(iter->end);
+
+ memset(iter, 0, sizeof(*iter));
+
+ git__free(iter);
+}
+
git_index *git_iterator_index_get_index(git_iterator *iter)
{
if (iter->type == GIT_ITERATOR_INDEX)