From 5d291d050ebd714851c6bd85efd49a03d88414f0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 18 Aug 2011 00:28:53 -0500 Subject: Remove usages of alpm_list_next() in backend Another function call that can be replaced by a single pointer dereference. Signed-off-by: Dan McGee --- lib/libalpm/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/util.c') diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 4dc0fbe7..27709c64 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -638,7 +638,7 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename) struct stat buf; /* Loop through the cache dirs until we find a matching file */ - for(i = alpm_option_get_cachedirs(handle); i; i = alpm_list_next(i)) { + for(i = alpm_option_get_cachedirs(handle); i; i = i->next) { snprintf(path, PATH_MAX, "%s%s", (char *)alpm_list_getdata(i), filename); if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) { @@ -663,7 +663,7 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle) char *cachedir; /* Loop through the cache dirs until we find a writeable dir */ - for(i = alpm_option_get_cachedirs(handle); i; i = alpm_list_next(i)) { + for(i = alpm_option_get_cachedirs(handle); i; i = i->next) { cachedir = alpm_list_getdata(i); if(stat(cachedir, &buf) != 0) { /* cache directory does not exist.... try creating it */ -- cgit v1.2.3-24-g4f1b