From 22df735b5ae02395b21925da2eb040fe7f70a7de Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 25 Feb 2010 21:50:20 +0200 Subject: [PATCH] Lose fluff from ensureOlder() - p and h can't possibly be NULL in the place this gets called - the single caller doesn't care about return value --- lib/transaction.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/lib/transaction.c b/lib/transaction.c index 98fa10b..dda5133 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -618,34 +618,20 @@ assert(otherFi != NULL); * @param p current transaction element * @param h installed header * @param ps problem set - * @return 0 if not newer, 1 if okay */ -static int ensureOlder(const rpmte p, const Header h, rpmps ps) +static void ensureOlder(const rpmte p, const Header h, rpmps ps) { rpmsenseFlags reqFlags = (RPMSENSE_LESS | RPMSENSE_EQUAL); rpmds req; - int rc; - - if (p == NULL || h == NULL) - return 1; req = rpmdsSingle(RPMTAG_REQUIRENAME, rpmteN(p), rpmteEVR(p), reqFlags); - rc = rpmdsNVRMatchesDep(h, req, _rpmds_nopromote); - req = rpmdsFree(req); - - if (rc == 0) { + if (rpmdsNVRMatchesDep(h, req, _rpmds_nopromote) == 0) { char * altNEVR = headerGetAsString(h, RPMTAG_NEVRA); - rpmpsAppend(ps, RPMPROB_OLDPACKAGE, - rpmteNEVRA(p), rpmteKey(p), - NULL, NULL, - altNEVR, - 0); - altNEVR = _free(altNEVR); - rc = 1; - } else - rc = 0; - - return rc; + rpmpsAppend(ps, RPMPROB_OLDPACKAGE, rpmteNEVRA(p), rpmteKey(p), + NULL, NULL, altNEVR, 0); + free(altNEVR); + } + rpmdsFree(req); } /** -- 2.7.4