diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-03-07 14:56:13 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-03-10 00:01:56 +0100 |
commit | 08a1244f4ef952be0c4897b9c5fee12a214be3f9 (patch) | |
tree | 816ea50316bdf8e69cb3ef99709b5df774729faa /lib/libalpm/sync.c | |
parent | d90641a894b915f5e13876bba88aa765c9961b0a (diff) | |
download | pacman-08a1244f4ef952be0c4897b9c5fee12a214be3f9.tar.gz pacman-08a1244f4ef952be0c4897b9c5fee12a214be3f9.tar.xz |
libalpm/sync: remove useless intermediate variable
This also rearranges some code to ensure that declarations and code
aren't mixed.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r-- | lib/libalpm/sync.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 147a8377..f9217bd4 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -212,9 +212,8 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* Search for replacers then literal (if no replacer) in each sync database. */ for(j = handle->dbs_sync; j; j = j->next) { alpm_db_t *sdb = j->data; + alpm_list_t *replacers = check_replacers(handle, lpkg, sdb); /* Check sdb */ - alpm_list_t *replacers; - replacers = check_replacers(handle, lpkg, sdb); if(replacers) { trans->add = alpm_list_join(trans->add, replacers); /* jump to next local package */ @@ -222,9 +221,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) } else { alpm_pkg_t *spkg = _alpm_db_get_pkgfromcache(sdb, lpkg->name); if(spkg) { - int literal_upgrade = 0; - literal_upgrade = check_literal(handle, lpkg, spkg, enable_downgrade); - if(literal_upgrade) { + if(check_literal(handle, lpkg, spkg, enable_downgrade)) { trans->add = alpm_list_add(trans->add, spkg); } /* jump to next local package */ |