flow: minor optimization

Most of the time FlowGetFlowFromHash will succeed.
pull/10134/head
Victor Julien 3 years ago committed by Victor Julien
parent 75c1b7fb10
commit 609cac58b7

@ -536,12 +536,10 @@ void FlowHandlePacket(ThreadVars *tv, FlowLookupStruct *fls, Packet *p)
* a new flow if necessary. If we get NULL, we're out of flow memory. * a new flow if necessary. If we get NULL, we're out of flow memory.
* The returned flow is locked. */ * The returned flow is locked. */
Flow *f = FlowGetFlowFromHash(tv, fls, p, &p->flow); Flow *f = FlowGetFlowFromHash(tv, fls, p, &p->flow);
if (f == NULL) if (f != NULL) {
return; /* set the flow in the packet */
p->flags |= PKT_HAS_FLOW;
/* set the flow in the packet */ }
p->flags |= PKT_HAS_FLOW;
return;
} }
/** \brief initialize the configuration /** \brief initialize the configuration

Loading…
Cancel
Save