diff options
author | Dan McGee <dan@archlinux.org> | 2007-01-30 04:46:33 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-01-30 04:46:33 +0100 |
commit | 1799afc9c144381150e181cee3a03a506b3e1d31 (patch) | |
tree | 5bfad94c39c4766a0b73b87b31924a58dae2d684 /lib/libalpm/alpm_list.c | |
parent | 358a4a62f325c0f043005cff72d79b813d2a318f (diff) | |
download | pacman-1799afc9c144381150e181cee3a03a506b3e1d31.tar.gz pacman-1799afc9c144381150e181cee3a03a506b3e1d31.tar.xz |
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.
Diffstat (limited to 'lib/libalpm/alpm_list.c')
-rw-r--r-- | lib/libalpm/alpm_list.c | 8 |
1 files changed, 4 insertions, 4 deletions
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) { |