From 8fd5253e3130dfa976311cb28fe6ae84e65ec14a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 22 Dec 2011 12:56:49 +0100 Subject: [PATCH] xbps_repository_pool_init: check repo arch before plist access(2), faster. --- lib/repository_pool.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/repository_pool.c b/lib/repository_pool.c index 4cd07fae..e673fa0d 100644 --- a/lib/repository_pool.c +++ b/lib/repository_pool.c @@ -104,6 +104,15 @@ xbps_repository_pool_init(const struct xbps_handle *xhp) continue; ntotal++; + /* + * Check if repository doesn't match our architecture. + */ + if (!check_repo_arch(repouri)) { + xbps_dbg_printf("[rpool] `%s' arch not matched, " + "ignoring.\n", repouri); + nmissing++; + continue; + } /* * If index file is not there, skip. */ @@ -119,16 +128,6 @@ xbps_repository_pool_init(const struct xbps_handle *xhp) nmissing++; continue; } - /* - * Check if repository doesn't match our architecture. - */ - if (!check_repo_arch(repouri)) { - xbps_dbg_printf("[rpool] `%s' arch not matched, " - "ignoring.\n", repouri); - free(plist); - nmissing++; - continue; - } /* * Internalize repository's index dictionary and add it * into the queue.