From: Dennis Schafroth Date: Thu, 10 May 2012 06:50:01 +0000 (+0200) Subject: Move nmem_reset up to beginning of loop, as it is a pre-condition. X-Git-Tag: v1.6.13~12 X-Git-Url: http://git.indexdata.com/?p=pazpar2-moved-to-github.git;a=commitdiff_plain;h=407df3f2f9da2bb3911bd3819b9fb966f4ea2264 Move nmem_reset up to beginning of loop, as it is a pre-condition. Should work as previous, but will report fewer nmem 0 bytes usage. One extra nmem_reset (on a empty) call is the price. --- diff --git a/src/client.c b/src/client.c index 9e52b0a..59e06cd 100644 --- a/src/client.c +++ b/src/client.c @@ -1092,7 +1092,7 @@ static int apply_limit(struct session_database *sdb, for (i = 0; (name = facet_limits_get(facet_limits, i, &value)); i++) { struct setting *s = 0; - + nmem_reset(nmem_tmp); for (s = sdb->settings[PZ_LIMITMAP]; s; s = s->next) { const char *p = strchr(s->name + 3, ':'); @@ -1148,7 +1148,6 @@ static int apply_limit(struct session_database *sdb, break; } } - nmem_reset(nmem_tmp); if (!s) { yaz_log(YLOG_WARN, "Target %s: limit %s used, but no limitmap defined",