From dee5d0e2308092b45af17bbc2a4aff4089b8a56f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 8 Jun 2009 14:48:36 +0300 Subject: [PATCH] rpmdsInit() and rpmdsNext() can handle NULL ds, no need to separately test --- lib/depends.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 2bfa755..77868da 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -1435,9 +1435,7 @@ int rpmtsCheck(rpmts ts) goto exit; rc = 0; - provides = rpmteDS(p, RPMTAG_PROVIDENAME); - provides = rpmdsInit(provides); - if (provides != NULL) + provides = rpmdsInit(rpmteDS(p, RPMTAG_PROVIDENAME)); while (rpmdsNext(provides) >= 0) { const char * Name; @@ -1460,7 +1458,7 @@ int rpmtsCheck(rpmts ts) */ pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, TR_REMOVED)) != NULL) { - rpmds provides; + rpmds provides = rpmdsInit(rpmteDS(p, RPMTAG_PROVIDENAME)); rpmfi fi; /* FIX: rpmts{A,O} can return null. */ @@ -1468,9 +1466,6 @@ int rpmtsCheck(rpmts ts) rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); rc = 0; - provides = rpmteDS(p, RPMTAG_PROVIDENAME); - provides = rpmdsInit(provides); - if (provides != NULL) while (rpmdsNext(provides) >= 0) { const char * Name; -- 2.7.4