git-commit-vandalism/refs
Jeff King 157113c614 prefix_ref_iterator: break when we leave the prefix
If the underlying iterator is ordered, then `prefix_ref_iterator` can
stop as soon as it sees a refname that comes after the prefix. This
will rarely make a big difference now, because `ref_cache_iterator`
only iterates over the directory containing the prefix (and usually
the prefix will span a whole directory anyway). But if *hint, hint* a
future reference backend doesn't itself know where to stop the
iteration, then this optimization will be a big win.

Note that there is no guarantee that the underlying iterator doesn't
include output preceding the prefix, so we have to skip over any
unwanted references before we get to the ones that we want.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-09-14 15:19:07 +09:00
..
files-backend.c ref_iterator: keep track of whether the iterator output is ordered 2017-09-14 15:19:07 +09:00
iterator.c prefix_ref_iterator: break when we leave the prefix 2017-09-14 15:19:07 +09:00
packed-backend.c ref_iterator: keep track of whether the iterator output is ordered 2017-09-14 15:19:07 +09:00
packed-backend.h packed-backend: rip out some now-unused code 2017-09-09 03:18:04 +09:00
ref-cache.c ref_iterator: keep track of whether the iterator output is ordered 2017-09-14 15:19:07 +09:00
ref-cache.h ref_iterator: keep track of whether the iterator output is ordered 2017-09-14 15:19:07 +09:00
refs-internal.h ref_iterator: keep track of whether the iterator output is ordered 2017-09-14 15:19:07 +09:00