summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-07-03 20:39:13 +0200
committerDan McGee <dan@archlinux.org>2011-07-03 20:39:13 +0200
commitf612e5ede7f76458911b78adca3323c61a669dd0 (patch)
tree62e1ec7bc067965189dbe719cf1f0ceafd322196
parent925d74f38d21121440edad3f7917c4326e2bd1db (diff)
downloadpacman-f612e5ede7f76458911b78adca3323c61a669dd0.tar.gz
pacman-f612e5ede7f76458911b78adca3323c61a669dd0.tar.xz
checkdeps: remove unnecessary list join and copy
We can just perform the same search operation on both lists. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/deps.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 6ca79c34..34f74a57 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -269,22 +269,20 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis
alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps)
{
alpm_list_t *i, *j;
- alpm_list_t *targets, *dblist = NULL, *modified = NULL;
+ alpm_list_t *dblist = NULL, *modified = NULL;
alpm_list_t *baddeps = NULL;
int nodepversion;
CHECK_HANDLE(handle, return NULL);
- targets = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade));
for(i = pkglist; i; i = i->next) {
alpm_pkg_t *pkg = i->data;
- if(_alpm_pkg_find(targets, pkg->name)) {
+ if(_alpm_pkg_find(remove, pkg->name) || _alpm_pkg_find(upgrade, pkg->name)) {
modified = alpm_list_add(modified, pkg);
} else {
dblist = alpm_list_add(dblist, pkg);
}
}
- alpm_list_free(targets);
nodepversion = no_dep_version(handle);