aboutsummaryrefslogtreecommitdiff
path: root/refs/files-backend.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-09-13 19:15:56 +0200
committerJunio C Hamano <gitster@pobox.com>2017-09-14 15:19:07 +0900
commit157113c614034dc247e1aa6fb65448125f71f7ca (patch)
tree64ac736c06763f297f74b4b172ae65985fa391ca /refs/files-backend.c
parent8738a8a4df9ee50112b5f5a757c58988166974d3 (diff)
downloadgit-157113c614034dc247e1aa6fb65448125f71f7ca.tar.gz
git-157113c614034dc247e1aa6fb65448125f71f7ca.tar.xz
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>
Diffstat (limited to 'refs/files-backend.c')
0 files changed, 0 insertions, 0 deletions