From: Panu Matilainen Date: Tue, 30 Mar 2010 20:23:53 +0000 (+0300) Subject: Minor cleanups to rpmdbAdd() and rpmdbRemove() X-Git-Tag: rpm-4.9.0-beta1~738 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55bcfaef71727c966de494d0dd4ba0527b4ac0a7;p=platform%2Fupstream%2Frpm.git Minor cleanups to rpmdbAdd() and rpmdbRemove() --- diff --git a/lib/rpmdb.c b/lib/rpmdb.c index aebf2be..2e781b3 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -2411,14 +2411,11 @@ int rpmdbRemove(rpmdb db, int rid, unsigned int hdrNum, if (dbiTags.tags != NULL) for (dbix = 0; dbix < dbiTags.max; dbix++) { - dbiIndex dbi; - rpmTag rpmtag; + dbiIndex dbi = NULL; + rpmTag rpmtag = dbiTags.tags[dbix]; int xx = 0; struct rpmtd_s tagdata; - dbi = NULL; - rpmtag = dbiTags.tags[dbix]; - if (rpmtag == RPMDBI_PACKAGES) { dbi = dbiOpen(db, rpmtag, 0); if (dbi == NULL) /* XXX shouldn't happen */ @@ -2652,14 +2649,12 @@ int rpmdbAdd(rpmdb db, int iid, Header h, if (dbiTags.tags != NULL) for (dbix = 0; dbix < dbiTags.max; dbix++) { - rpmTag rpmtag; - rpmRC rpmrc; + rpmTag rpmtag = dbiTags.tags[dbix]; + rpmRC rpmrc = RPMRC_NOTFOUND; int j; struct rpmtd_s tagdata, reqflags; - rpmrc = RPMRC_NOTFOUND; dbi = NULL; - rpmtag = dbiTags.tags[dbix]; switch (rpmtag) { case RPMDBI_PACKAGES: