Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/cache.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-18 22:37:16 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-18 22:37:16 +0000
commitcf94007aed7eb87a38090a62b9ddf606ea1343c9 (patch)
tree828390f91f1e8510522c63d97d9c61cf443bbc24 /lib/libalpm/cache.c
parentc7bcaeb7e82b9b74ab9734863827ff98db2b1fdd (diff)
more code cleanup yet
Diffstat (limited to 'lib/libalpm/cache.c')
-rw-r--r--lib/libalpm/cache.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c
index 8c8e7669..709ba383 100644
--- a/lib/libalpm/cache.c
+++ b/lib/libalpm/cache.c
@@ -145,21 +145,11 @@ int db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg)
pmpkg_t *db_get_pkgfromcache(pmdb_t *db, char *target)
{
- PMList *i;
-
- if(db == NULL || target == NULL || strlen(target) == 0) {
+ if(db == NULL) {
return(NULL);
}
- for(i = db_get_pkgcache(db); i; i = i->next) {
- pmpkg_t *info = i->data;
-
- if(strcmp(info->name, target) == 0) {
- return(info);
- }
- }
-
- return(NULL);
+ return(pkg_isin(target, db_get_pkgcache(db)));
}
/* Returns a new group cache from db.