From aafefa6c2383a9f059ebcf0494251b515dd6588f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 3 Jan 2009 14:59:55 +0100 Subject: [PATCH] Simplify xbps_add_pkg_dependency(). --HG-- extra : convert_revision : d4702da2278e65eabf998f2cbe7b3cd10eb34852 --- lib/depends.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 77bc084d74a..b268d4ff5e1 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -166,7 +166,7 @@ xbps_destroy_dependency(struct pkg_dependency *dep) void xbps_add_pkg_dependency(const char *pkg, uint64_t prio, prop_dictionary_t repo) { - struct pkg_dependency *dep, *dep_prev; + struct pkg_dependency *dep; size_t len = 0; char *pkgname; @@ -200,20 +200,7 @@ xbps_add_pkg_dependency(const char *pkg, uint64_t prio, prop_dictionary_t repo) dep->priority = prio; dep->reqcount = 0; - if (SIMPLEQ_EMPTY(&pkg_deps)) { - SIMPLEQ_INSERT_TAIL(&pkg_deps, dep, deps); - return; - } - - /* - * If package has a higher priority, it must be installed - * before other ones with lower priority. - */ - dep_prev = SIMPLEQ_FIRST(&pkg_deps); - if (prio > dep_prev->priority) - SIMPLEQ_INSERT_HEAD(&pkg_deps, dep, deps); - else - SIMPLEQ_INSERT_TAIL(&pkg_deps, dep, deps); + SIMPLEQ_INSERT_TAIL(&pkg_deps, dep, deps); } static int