flow: minor optimization

Most of the time FlowGetFlowFromHash will succeed.
pull/10134/head
Victor Julien 1 year 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.
* The returned flow is locked. */
Flow *f = FlowGetFlowFromHash(tv, fls, p, &p->flow);
if (f == NULL)
return;
/* set the flow in the packet */
p->flags |= PKT_HAS_FLOW;
return;
if (f != NULL) {
/* set the flow in the packet */
p->flags |= PKT_HAS_FLOW;
}
}
/** \brief initialize the configuration

Loading…
Cancel
Save