]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: minor code cleanup
authorVictor Julien <vjulien@oisf.net>
Mon, 15 Aug 2022 12:37:22 +0000 (14:37 +0200)
committerShivani Bhardwaj <shivani@oisf.net>
Mon, 29 Aug 2022 04:25:59 +0000 (09:55 +0530)
src/stream-tcp-list.c

index 7dde2b0ea9343d7a62ab05bee5198a1e510bba87..cbd3c4e818d0d55de2675cf43856e744cb49ad6d 100644 (file)
@@ -760,22 +760,10 @@ static inline uint64_t GetLeftEdgeForApp(Flow *f, TcpSession *ssn, TcpStream *st
 
 static inline uint64_t GetLeftEdge(Flow *f, TcpSession *ssn, TcpStream *stream)
 {
-    bool use_app = true;
-    bool use_raw = true;
-    bool use_log = true;
-
     uint64_t left_edge = 0;
-    if ((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED)) {
-        use_app = false; // app is dead
-    }
-
-    if (stream->flags & STREAMTCP_STREAM_FLAG_DISABLE_RAW) {
-        use_raw = false; // raw is dead
-    }
-    if (!stream_config.streaming_log_api) {
-        use_log = false;
-    }
-
+    const bool use_app = !(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED);
+    const bool use_raw = !(stream->flags & STREAMTCP_STREAM_FLAG_DISABLE_RAW);
+    const bool use_log = stream_config.streaming_log_api;
     SCLogDebug("use_app %d use_raw %d use_log %d", use_app, use_raw, use_log);
 
     if (use_raw) {