Browse Source

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
pull/1682/head
Richard Fuchs 3 years ago
parent
commit
e8d42b53cd
1 changed files with 1 additions and 6 deletions
  1. +1
    -6
      daemon/call.c

+ 1
- 6
daemon/call.c View File

@ -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) {


Loading…
Cancel
Save