diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2018-01-24 12:14:14 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-01-24 12:55:26 -0800 |
commit | f34242975fae1468dd94d31289d27f68853a28fb (patch) | |
tree | 2089da2e073c4a2f5d98add5f86b4f31ce7e5174 /streaming.h | |
parent | find_reference_location(): make function safe for empty snapshots (diff) | |
download | tgif-f34242975fae1468dd94d31289d27f68853a28fb.tar.xz |
packed_ref_iterator_begin(): make optimization more general
We can return an empty iterator not only if the `packed-refs` file is
missing, but also if it is empty or if there are no references whose
names succeed `prefix`. Optimize away those cases as well by moving
the call to `find_reference_location()` higher in the function and
checking whether the determined start position is the same as
`snapshot->eof`. (This is possible now because the previous commit
made `find_reference_location()` robust against empty snapshots.)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'streaming.h')
0 files changed, 0 insertions, 0 deletions