forked from Mirrors/sngrep
Refactor loops with vector iterators
This commit is contained in:
parent
255433595b
commit
c408362247
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user