From 11bf5f8b654df2996bff3f01925bbbc8eccfa76a Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sun, 24 Apr 2005 20:04:52 +0000 Subject: some more efficiency in remove_prepare() cascade loop --- lib/libalpm/remove.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 3a2eab93..279e2cb9 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -67,7 +67,6 @@ int remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) int remove_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data) { - pmpkg_t *info; PMList *lp; ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); @@ -84,11 +83,12 @@ int remove_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data) PMList *j; for(j = lp; j; j = j->next) { pmdepmissing_t* miss = (pmdepmissing_t*)j->data; - info = db_scan(db, miss->depend.name, INFRQ_ALL); + pmpkg_t *info = db_get_pkgfromcache(db, miss->depend.name); if(!pkg_isin(info, trans->packages)) { + /* ORE + see remove_loadtarget() on how to avoid db_scan() */ + info = db_scan(db, miss->depend.name, INFRQ_ALL); trans->packages = pm_list_add(trans->packages, info); - } else { - FREEPKG(info); } } FREELIST(lp); -- cgit v1.2.3-70-g09d2