xbps_repository_pool_init: check repo arch before plist access(2), faster.

This commit is contained in:
Juan RP 2011-12-22 12:56:49 +01:00
parent 939e2c2417
commit 8fd5253e31

View File

@ -104,6 +104,15 @@ xbps_repository_pool_init(const struct xbps_handle *xhp)
continue; continue;
ntotal++; 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. * If index file is not there, skip.
*/ */
@ -119,16 +128,6 @@ xbps_repository_pool_init(const struct xbps_handle *xhp)
nmissing++; nmissing++;
continue; 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 * Internalize repository's index dictionary and add it
* into the queue. * into the queue.