From 0024221279db33c2d531badf9cd70ee3cb7190c4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 28 Oct 2009 03:16:52 +0100 Subject: [PATCH] lib/depends.c: minor performance change. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091028021652-ns74gpr86ohfok9a --- lib/depends.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 8aaca1cc..ee7dcd4e 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -276,15 +276,14 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo, */ while ((obj = prop_object_iterator_next(iter))) { reqpkg = prop_string_cstring_nocopy(obj); - pkgname = xbps_get_pkg_name(reqpkg); - reqvers = xbps_get_pkg_version(reqpkg); /* * Check if required dep is satisfied and installed. */ - if (xbps_check_is_installed_pkg(reqpkg) >= 0) { - free(pkgname); + if (xbps_check_is_installed_pkg(reqpkg) >= 0) continue; - } + + pkgname = xbps_get_pkg_name(reqpkg); + reqvers = xbps_get_pkg_version(reqpkg); /* * Check if package is already added in the * array of unsorted deps.