From 1799afc9c144381150e181cee3a03a506b3e1d31 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 30 Jan 2007 03:46:33 +0000 Subject: Discussed on IRC for a bit, this makes the following changes for clarity: * alpm_list_is_in --> alpm_list_find * alpm_list_is_strin --> alpm_list_find_str * Flip parameters of both functions to be inline with rest of alpm_list. First commit, woohoo. --- lib/libalpm/alpm_list.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/alpm_list.c') diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c index edb2e8e5..d553499e 100644 --- a/lib/libalpm/alpm_list.c +++ b/lib/libalpm/alpm_list.c @@ -309,7 +309,7 @@ alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list) { /* TODO does removing the strdup here cause invalid free's anywhere? */ alpm_list_t *lp = list, *newlist = NULL; while(lp) { - if(!alpm_list_is_in(lp->data, newlist)) { + if(!alpm_list_find(newlist, lp->data)) { newlist = alpm_list_add(newlist, lp->data); } lp = lp->next; @@ -426,7 +426,7 @@ int alpm_list_count(const alpm_list_t *list) * @param haystack the list to search * @return 1 if `needle` is found, 0 otherwise */ -int alpm_list_is_in(const void *needle, alpm_list_t *haystack) +int alpm_list_find(alpm_list_t *haystack, const void *needle) { alpm_list_t *lp = haystack; while(lp) { @@ -440,12 +440,12 @@ int alpm_list_is_in(const void *needle, alpm_list_t *haystack) /* Test for existence of a string in a alpm_list_t */ -/** Is a _string_ in the list (optimization of alpm_list_is_in for strings) +/** Is a _string_ in the list (optimization of alpm_list_find for strings) * @param needle the string to compare * @param haystack the list to search * @return 1 if `needle` is found, 0 otherwise */ -int alpm_list_is_strin(const char *needle, alpm_list_t *haystack) +int alpm_list_find_str(alpm_list_t *haystack, const char *needle) { alpm_list_t *lp = haystack; while(lp) { -- cgit v1.2.3