aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-11 10:33:35 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-11 10:33:35 -0700
commit294792326ae86c276897a0fd694948d2fb5640de (patch)
treeae654ed33d74c0102cc586ea8a3e026c94427d5e /sha1_name.c
parentb6a1261751c7f9d9a04a57585c305f3b0e0f378e (diff)
parent3bc7a05b1a78b850da94ca85267ca279489ce70f (diff)
downloadgit-294792326ae86c276897a0fd694948d2fb5640de.tar.gz
git-294792326ae86c276897a0fd694948d2fb5640de.tar.xz
Merge branch 'rs/list-optim'
Fix a couple of "accumulate into a sorted list" to "accumulate and then sort the list". * rs/list-optim: walker: avoid quadratic list insertion in mark_complete sha1_name: avoid quadratic list insertion in handle_one_ref
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 63ee66fed..7098b10e3 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -839,7 +839,7 @@ static int handle_one_ref(const char *path,
}
if (object->type != OBJ_COMMIT)
return 0;
- commit_list_insert_by_date((struct commit *)object, list);
+ commit_list_insert((struct commit *)object, list);
return 0;
}
@@ -1366,6 +1366,7 @@ static int get_sha1_with_context_1(const char *name,
if (!only_to_die && namelen > 2 && name[1] == '/') {
struct commit_list *list = NULL;
for_each_ref(handle_one_ref, &list);
+ commit_list_sort_by_date(&list);
return get_sha1_oneline(name + 2, sha1, list);
}
if (namelen < 3 ||