Re: [PATCH 4/6] packed_ref_iterator_begin(): make optimization more general

2018-01-24 Thread Jeff King
On Wed, Jan 24, 2018 at 12:14:14PM +0100, Michael Haggerty wrote: > 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

[PATCH 4/6] packed_ref_iterator_begin(): make optimization more general

2018-01-24 Thread Michael Haggerty
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