summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-04-24 20:04:52 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-04-24 20:04:52 +0000
commit11bf5f8b654df2996bff3f01925bbbc8eccfa76a (patch)
tree68e677ba2c7ec1b060c8555ce055bac0d649c168 /lib/libalpm/remove.c
parent55704d374255fa39e74af5c46c144c2d37d01650 (diff)
downloadpacman-11bf5f8b654df2996bff3f01925bbbc8eccfa76a.tar.xz
some more efficiency in remove_prepare() cascade loop
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c8
1 files changed, 4 insertions, 4 deletions
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);