From: Victor Julien Date: Sun, 24 May 2015 16:38:39 +0000 (+0200) Subject: counters: simplify and speedup counters sync X-Git-Tag: suricata-3.0RC1~379 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f300ad253ee88337d3e388540f1375a109fb6e38;p=thirdparty%2Fsuricata.git counters: simplify and speedup counters sync --- diff --git a/src/counters.c b/src/counters.c index 309a290da1..27056b6fd3 100644 --- a/src/counters.c +++ b/src/counters.c @@ -1188,7 +1188,6 @@ int SCPerfSetupPrivate(ThreadVars *tv) */ int SCPerfUpdateCounterArray(SCPerfPrivateContext *pca, SCPerfPublicContext *pctx) { - SCPerfCounter *pc = NULL; SCPCAElem *pcae = NULL; uint32_t i = 0; @@ -1200,22 +1199,9 @@ int SCPerfUpdateCounterArray(SCPerfPrivateContext *pca, SCPerfPublicContext *pct pcae = pca->head; SCMutexLock(&pctx->m); - pc = pctx->head; - for (i = 1; i <= pca->size; i++) { - while (pc != NULL) { - if (pc->id != pcae[i].id) { - pc = pc->next; - continue; - } - - SCPerfCopyCounterValue(&pcae[i]); - - pc = pc->next; - break; - } + SCPerfCopyCounterValue(&pcae[i]); } - SCMutexUnlock(&pctx->m); pctx->perf_flag = 0;