Commit bfec6526e931d7f6ac5ecc38c37e76163092bfda

Marcin Krystianc 2018-09-02T11:38:43

git_remote_prune to be O(n * logn)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/remote.c b/src/remote.c
index 9c0e88a..b0d7203 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1234,7 +1234,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
 				goto cleanup;
 
 			key.name = (char *) git_buf_cstr(&buf);
-			error = git_vector_search(&pos, &remote_refs, &key);
+			error = git_vector_bsearch(&pos, &remote_refs, &key);
 			git_buf_dispose(&buf);
 
 			if (error < 0 && error != GIT_ENOTFOUND)