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.13.0-rc1~538 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3140bffe7c33b7600c6aa34180599144423eb981;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 7afee7fc..9ee91ae3 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -764,8 +764,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;