From e8d42b53cd7f976216deac6d2622bb0b10a8dfd6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 26 Apr 2023 13:00:19 -0400 Subject: [PATCH] TT#146201 improve find_subscription This is a convenience function that does an unnecessary loop iteration. We have a hash table to perform the exact lookup needed. Turn the function into a simple wrapper which uses the hash table. Change-Id: If91976a955dea80e882656849b0b13d426e5748f --- daemon/call.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 29cea5301..aab226878 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2374,12 +2374,7 @@ static void __update_media_protocol(struct call_media *media, struct call_media } static struct call_subscription *find_subscription(struct call_monologue *ml, struct call_monologue *sub) { - for (GList *l = ml->subscribers.head; l; l = l->next) { - struct call_subscription *cs = l->data; - if (cs->monologue == sub) - return cs; - } - return NULL; + return call_get_call_subscription(ml->subscribers_ht, sub); } static void set_transcoding_flag(struct call_monologue *ml, struct call_monologue *sub, bool flag) {