From: Francis Deslauriers Date: Fri, 6 Dec 2019 22:49:35 +0000 (-0500) Subject: liblttng-ust: exit loop early on event enabler match X-Git-Tag: v2.11.1~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9f9d766045eb01bf9ae793e3439224bc51ba4fc4;p=lttng-ust.git liblttng-ust: exit loop early on event enabler match Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: I0fa3215f7cd6a2d32ac00d66cf5fc184abd14612 --- diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index 255c4b95..19fba81c 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -766,8 +766,10 @@ void lttng_create_event_if_missing(struct lttng_enabler *enabler) head = &session->events_ht.table[hash & (LTTNG_UST_EVENT_HT_SIZE - 1)]; cds_hlist_for_each_entry(event, node, head, hlist) { if (event->desc == desc - && event->chan == enabler->chan) + && event->chan == enabler->chan) { found = 1; + break; + } } if (found) continue;