author | Julian Phillips <julian@quantumfyre.co.uk> | |
Sun, 25 Oct 2009 21:28:11 +0000 (21:28 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 28 Oct 2009 06:38:43 +0000 (23:38 -0700) | ||
commit | 73cf0822b2a4ffa7ad559d1f0772e39718fc7776 | |
tree | f000a3c8df85cba4ac0324f7c23406309c24236b | tree | snapshot |
parent | e984c54ada086e7676419b6b1b8a2d7a2429da48 | commit | diff |
remote: Make ref_remove_duplicates faster for large numbers of refs
The ref_remove_duplicates function was very slow at dealing with very
large numbers of refs. This is because it was using a linear search
through all remaining refs to find any duplicates of the current ref.
Rewriting it to use a string list to keep track of which refs have
already been seen and removing duplicates when they are found is much
more efficient.
Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The ref_remove_duplicates function was very slow at dealing with very
large numbers of refs. This is because it was using a linear search
through all remaining refs to find any duplicates of the current ref.
Rewriting it to use a string list to keep track of which refs have
already been seen and removing duplicates when they are found is much
more efficient.
Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | diff | blob | history |