summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aaaff9e)
raw | patch | inline | side by side (parent: aaaff9e)
author | Christian Couder <chriscool@tuxfamily.org> | |
Sat, 9 May 2009 15:55:44 +0000 (17:55 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 May 2009 21:30:30 +0000 (14:30 -0700) |
This makes sha1_array easier to use, so later patches will be simpler.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c | patch | blob | history |
diff --git a/bisect.c b/bisect.c
index 77edecaaec373c7395ddec8bf87088e660255659..d2a34d1e5175a19babe5c0194308254279951b04 100644 (file)
--- a/bisect.c
+++ b/bisect.c
unsigned char (*sha1)[20];
int sha1_nr;
int sha1_alloc;
+ int sorted;
};
static struct sha1_array good_revs;
static void sort_sha1_array(struct sha1_array *array)
{
qsort(array->sha1, array->sha1_nr, sizeof(*array->sha1), array_cmp);
+
+ array->sorted = 1;
}
static const unsigned char *sha1_access(size_t index, void *table)
static int lookup_sha1_array(struct sha1_array *array,
const unsigned char *sha1)
{
+ if (!array->sorted)
+ sort_sha1_array(array);
+
return sha1_pos(sha1, array->sha1, array->sha1_nr, sha1_access);
}
if (!skipped_revs.sha1_nr)
return list;
- sort_sha1_array(&skipped_revs);
-
while (list) {
struct commit_list *next = list->next;
list->next = NULL;