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-10 23:11:42 +0400
committerRussell Belfer <rb@github.com>2013-01-15 21:51:35 +0400
commitfffe429a20b68677cae940ba8a9a0ff60056d6c0 (patch)
treeb81ae2ac2fbb5bba8a053f17f9f5601ce1abaaf1 /src/iterator.c
parent25423d03b826f9647e72a56b14e08967d92ae479 (diff)
Shortcut spool and sort for empty iterator
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 0b6a4fc15..56b262975 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -1032,6 +1032,11 @@ int git_iterator_spoolandsort_push(git_iterator *iter, bool ignore_case)
if (((iter->flags & GIT_ITERATOR_IGNORE_CASE) != 0) == (ignore_case != 0))
return 0;
+ if (iter->type == GIT_ITERATOR_TYPE_EMPTY) {
+ iter->flags = (iter->flags ^ GIT_ITERATOR_IGNORE_CASE);
+ return 0;
+ }
+
scb = git__calloc(1, sizeof(spoolandsort_callbacks));
GITERR_CHECK_ALLOC(scb);