Refactor loops with vector iterators

This commit is contained in:
Kaian 2015-09-28 18:48:31 +02:00
parent 255433595b
commit c408362247
2 changed files with 4 additions and 6 deletions

View File

@ -45,8 +45,6 @@ typedef struct sip_call_group sip_call_group_t;
* This structure is used for displaying more than one dialog in the
* same call flow. Instead of displaying a call flow, we will display
* a calls group flow.
*
* @fixme Remove 1024 "limitation"
*/
struct sip_call_group {
//! Calls array in the group

View File

@ -383,15 +383,15 @@ sip_call_t *
sip_find_by_xcallid(const char *xcallid)
{
sip_call_t *cur;
int i;
vector_iter_t it;
//FIXME Iterator pls?
for (i=0; i < vector_count(calls.list); i++) {
cur = vector_item(calls.list, i);
// Find the call with the given X-Call-Id
while ((cur = vector_iterator_next(&it))) {
if (cur->xcallid && !strcmp(cur->xcallid, xcallid)) {
return cur;
}
}
// None found
return NULL;
}