From 5e01d838412d6679c40c929bbb2591669ae393d4 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 21 Feb 2024 13:37:35 +0100 Subject: refs: always treat iterators as ordered In the preceding commit we have converted the reflog iterator of the "files" backend to be ordered, which was the only remaining ref iterator that wasn't ordered. Refactor the ref iterator infrastructure so that we always assume iterators to be ordered, thus simplifying the code. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- refs/ref-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'refs/ref-cache.c') diff --git a/refs/ref-cache.c b/refs/ref-cache.c index a372a00941..9f9797209a 100644 --- a/refs/ref-cache.c +++ b/refs/ref-cache.c @@ -486,7 +486,7 @@ struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache, CALLOC_ARRAY(iter, 1); ref_iterator = &iter->base; - base_ref_iterator_init(ref_iterator, &cache_ref_iterator_vtable, 1); + base_ref_iterator_init(ref_iterator, &cache_ref_iterator_vtable); ALLOC_GROW(iter->levels, 10, iter->levels_alloc); iter->levels_nr = 1; -- cgit v1.3