summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2019-03-27 14:11:10 -0700
committerJunio C Hamano <gitster@pobox.com>2019-04-01 15:51:05 +0900
commitb7643009123216792aa158d3b2ca64a79adc01e2 (patch)
tree05a197eaf32b132f94c6ed1089c7c53c758ca265 /commit.h
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
fetch-pack: binary search when storing wanted-refs
In do_fetch_pack_v2(), the "sought" array is sorted by name, and it is not subsequently reordered (within the function). Therefore, receive_wanted_refs() can assume that "sought" is sorted, and can thus use a binary search when storing wanted-refs retrieved from the server. Replace the existing linear search with a binary search. This improves performance significantly when mirror cloning a repository with more than 1 million refs. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions