1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-05 00:55:04 -05:00

call alpm_option_get_localdb once in syncfirst()

Signed-off-by: Andrea Scarpino <andrea@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Andrea Scarpino 2011-03-29 17:43:07 +02:00 committed by Dan McGee
parent 1a8c792e8f
commit b6ecb2329b

View File

@ -578,10 +578,11 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
static alpm_list_t *syncfirst(void) {
alpm_list_t *i, *res = NULL;
pmdb_t *db_local = alpm_option_get_localdb();
for(i = config->syncfirst; i; i = alpm_list_next(i)) {
char *pkgname = alpm_list_getdata(i);
pmpkg_t *pkg = alpm_db_get_pkg(alpm_option_get_localdb(), pkgname);
pmpkg_t *pkg = alpm_db_get_pkg(db_local, pkgname);
if(pkg == NULL) {
continue;
}