From 5b91cec4ae717722524bc5092482b1f20ee20fac Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sat, 24 Dec 2011 14:40:25 +0530 Subject: [PATCH] remove unnecessary if/else checks --- src/detect-engine-mpm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 004b86c0b8..929f3db45b 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -727,8 +727,11 @@ static void PopulateMpmAddPatternToMpm(DetectEngineCtx *de_ctx, { s->mpm_sm = mpm_sm; - /* now add the mpm_ch to the mpm ctx */ - if (mpm_sm != NULL) { + if (mpm_sm == NULL) { + SCLogDebug("%"PRIu32" no mpm pattern selected", s->id); + return; + } + uint8_t flags = 0; DetectContentData *cd = NULL; @@ -1319,9 +1322,6 @@ static void PopulateMpmAddPatternToMpm(DetectEngineCtx *de_ctx, SCLogDebug("%"PRIu32" adding cd->id %"PRIu32" to the mpm phase " "(s->num %"PRIu32")", s->id, ((DetectContentData *)mpm_sm->ctx)->id, s->num); - } else { - SCLogDebug("%"PRIu32" no mpm pattern selected", s->id); - } /* else - if (mpm_sm != NULL) */ return; }