From 5553a544822bb406e813e44989e2e7c37ab09146 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 7 May 2009 14:31:57 +0300 Subject: [PATCH] Dont bother generation rpmds debug messages unless in debug mode - rpmdsNotify() which does nothing but generate RPMLOG_DEBUG messages gets called often enough that avoiding the unnecessary rpmlog() and strcmp() calls is easily visible in wallclock times (cherry picked from commit acd93ee570990ba3f549947dfe67a7d362f7c70d) --- lib/rpmds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/rpmds.c b/lib/rpmds.c index db8c9c2..286959e 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -456,6 +456,8 @@ int32_t rpmdsSetRefs(const rpmds ds, int32_t refs) void rpmdsNotify(rpmds ds, const char * where, int rc) { + if (!rpmIsDebug()) + return; if (!(ds != NULL && ds->i >= 0 && ds->i < ds->Count)) return; if (!(ds->Type != NULL && ds->DNEVR != NULL)) -- 2.7.4