summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-24 00:40:03 -0500
committerDan McGee <dan@archlinux.org>2011-06-24 01:36:47 -0500
commitf12ead2cf278d4a9b330d0d320733960fc750e96 (patch)
tree28ff56150e10d9c212c46edfb3d34c137b9a61a9 /src
parentd589a7b5dbdfcf740d72aa4e9e8fcab9a3de0fbd (diff)
downloadpacman-f12ead2cf278d4a9b330d0d320733960fc750e96.tar.xz
Remove three unnecessary usages of alpm_list_count()
For the files count when loading from a package, we can keep a counter. The two in the frontend were completely useless due to the fact that if sync_dbs is non-NULL, alpm_list_count() will always be greater than 0. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/query.c2
-rw-r--r--src/pacman/sync.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pacman/query.c b/src/pacman/query.c
index aa779075..62472cb7 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -502,7 +502,7 @@ int pacman_query(alpm_list_t *targets)
if(config->op_q_foreign) {
/* ensure we have at least one valid sync db set up */
alpm_list_t *sync_dbs = alpm_option_get_syncdbs(config->handle);
- if(sync_dbs == NULL || alpm_list_count(sync_dbs) == 0) {
+ if(sync_dbs == NULL) {
pm_printf(PM_LOG_ERROR, _("no usable package repositories configured.\n"));
return 1;
}
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index acb8a333..6c86bd10 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -911,7 +911,7 @@ int pacman_sync(alpm_list_t *targets)
/* ensure we have at least one valid sync db set up */
sync_dbs = alpm_option_get_syncdbs(config->handle);
- if(sync_dbs == NULL || alpm_list_count(sync_dbs) == 0) {
+ if(sync_dbs == NULL) {
pm_printf(PM_LOG_ERROR, _("no usable package repositories configured.\n"));
return 1;
}