From 0f9cef69c0b7f8a7cc3b0bbbbe6595583f6ced33 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 4 Nov 2010 14:09:33 +0200 Subject: [PATCH] Eliminate unused strlen() calls 'n stuff from skipInstallFiles() - These were used by the netsharedpath calculations which used to be inline here, but that's now in a function of their own. Also move the temporary variables to the scope where they're actually used. --- lib/transaction.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/transaction.c b/lib/transaction.c index 85b99fa..ad1ed7f 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -692,8 +692,6 @@ static void skipInstallFiles(const rpmts ts, rpmte p) rpm_color_t FColor; int noConfigs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONFIGS); int noDocs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NODOCS); - const char * dn, * bn; - size_t dnlen, bnlen; int * drc; char * dff; int dc; @@ -710,17 +708,11 @@ static void skipInstallFiles(const rpmts ts, rpmte p) dff = xcalloc(dc, sizeof(*dff)); fi = rpmfiInit(fi, 0); - while ((i = rpmfiNext(fi)) >= 0) - { + while ((i = rpmfiNext(fi)) >= 0) { char ** nsp; const char *flangs; - bn = rpmfiBN(fi); - bnlen = strlen(bn); ix = rpmfiDX(fi); - dn = rpmfiDN(fi); - dnlen = strlen(dn); - drc[ix]++; /* Don't bother with skipped files */ @@ -795,6 +787,8 @@ static void skipInstallFiles(const rpmts ts, rpmte p) /* Skip (now empty) directories that had skipped files. */ for (j = 0; j < dc; j++) { + const char * dn, * bn; + size_t dnlen, bnlen; if (drc[j]) continue; /* dir still has files. */ if (!dff[j]) continue; /* dir was not emptied here. */ -- 2.7.4