From 103dbb9fd14fde35e116819808e6d4c9b534eaa2 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 13 Feb 2007 08:15:38 +0000 Subject: * Refactored conflict checking within packages. Profiling from Dan showed an unbelievable amount of strcmp() calls (25 million) due to the list searching. This has been reimplemented with a set-intersection scheme, due to the fact that file lists are always ordered. - NEEDS TESTING * Minor clean up, "globalized" the str_cmp helper to match the alpm comparison signature, so we can use it elsewhere. --- lib/libalpm/alpm_list.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/alpm_list.h') diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h index 5798558b..be78245c 100644 --- a/lib/libalpm/alpm_list.h +++ b/lib/libalpm/alpm_list.h @@ -46,8 +46,8 @@ void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn); /* item mutators */ alpm_list_t *alpm_list_add(alpm_list_t *list, void *data); alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cmp fn); -alpm_list_t* alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn); -alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn); +alpm_list_t *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn); +alpm_list_t *alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn); alpm_list_t *alpm_list_remove(alpm_list_t *haystack, void *needle, alpm_list_fn_cmp fn, void **data); alpm_list_t *alpm_list_remove_node(alpm_list_t *node); alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list); @@ -56,7 +56,7 @@ alpm_list_t *alpm_list_reverse(alpm_list_t *list); /* item accessors */ alpm_list_t *alpm_list_first(alpm_list_t *list); -alpm_list_t* alpm_list_nth(alpm_list_t *list, int n); +alpm_list_t *alpm_list_nth(alpm_list_t *list, int n); alpm_list_t *alpm_list_next(alpm_list_t *list); alpm_list_t *alpm_list_last(alpm_list_t *list); void *alpm_list_getdata(const alpm_list_t *entry); -- cgit v1.2.3-24-g4f1b