From: Victor Julien Date: Mon, 4 Apr 2022 11:30:19 +0000 (+0200) Subject: detect/mpm: initialization micro optimization X-Git-Tag: suricata-7.0.0-beta1~779 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7204%2Fhead;p=thirdparty%2Fsuricata.git detect/mpm: initialization micro optimization --- diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index c467dc26b8..afff06d960 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -1093,10 +1093,14 @@ void RetrieveFPForSig(const DetectEngineCtx *de_ctx, Signature *s) /* inspect rule to see if we have the fast_pattern reg to * force using a sig, otherwise keep stats about the patterns */ - for (int list_id = 0; list_id < nlists; list_id++) { + for (int list_id = DETECT_SM_LIST_PMATCH; list_id < nlists; list_id++) { if (s->init_data->smlists[list_id] == NULL) continue; + if (list_id == DETECT_SM_LIST_POSTMATCH || list_id == DETECT_SM_LIST_TMATCH || + list_id == DETECT_SM_LIST_SUPPRESS || list_id == DETECT_SM_LIST_THRESHOLD) + continue; + if (!FastPatternSupportEnabledForSigMatchList(de_ctx, list_id)) continue;