summaryrefslogtreecommitdiff
path: root/remote.h
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-10-30 06:33:07 +0100
committerJunio C Hamano <gitster@pobox.com>2013-10-30 14:16:41 -0700
commit09ea1f8e0e85dd65307b29219ef1f5a3958eb918 (patch)
tree1a9b68e600ee6408c1926d675d2b28e6bf8f2239 /remote.h
parent37f0dcbdc1585dafd81c393aa750292e8634035d (diff)
downloadgit-09ea1f8e0e85dd65307b29219ef1f5a3958eb918.tar.gz
ref_remove_duplicates(): avoid redundant bisection
The old code called string_list_lookup(), and if that failed called string_list_insert(), thus doing the bisection search through the string list twice in the latter code path. Instead, just call string_list_insert() right away. If an entry for that peer reference name already existed, then its util pointer is always non-NULL. Of course this doesn't change the fact that the repeated string_list_insert() calls make the function scale like O(N^2) if the input reference list is not already approximately sorted. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.h')
0 files changed, 0 insertions, 0 deletions