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.12.0-rc2~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=747ecf43b52df79b34faa2bd4eaf6e5150b49b56;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 047759b7..f68ce323 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;