From fffe429a20b68677cae940ba8a9a0ff60056d6c0 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 10 Jan 2013 11:11:42 -0800 Subject: Shortcut spool and sort for empty iterator --- src/iterator.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/iterator.c') 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); -- cgit v1.2.3