diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-06 02:29:18 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-06 02:29:18 +0000 |
commit | 7b1b9f53ef47abd82c6faba12f4adcf721e622da (patch) | |
tree | be967c9ab3099202d13219196b5f17284a939e78 /apps/app_groupcount.c | |
parent | d39208dd35ce0ead92bf6a4b21361f3d13759589 (diff) |
more efficient (and understandable) ast_channel_walk_locked, and vastly more efficient ast_channel_by_name_locked (bug #4265)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5853 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_groupcount.c')
-rwxr-xr-x | apps/app_groupcount.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/app_groupcount.c b/apps/app_groupcount.c index f7ac15763..d17521001 100755 --- a/apps/app_groupcount.c +++ b/apps/app_groupcount.c @@ -174,9 +174,8 @@ static int group_show_channels(int fd, int argc, char *argv[]) havepattern = 1; } - c = ast_channel_walk_locked(NULL); ast_cli(fd, FORMAT_STRING, "Channel", "Group", "Category"); - while(c) { + while ( (c = ast_channel_walk_locked(c)) != NULL) { headp=&c->varshead; AST_LIST_TRAVERSE(headp,current,entries) { if (!strncmp(ast_var_name(current), GROUP_CATEGORY_PREFIX "_", strlen(GROUP_CATEGORY_PREFIX) + 1)) { @@ -194,7 +193,6 @@ static int group_show_channels(int fd, int argc, char *argv[]) } numchans++; ast_mutex_unlock(&c->lock); - c = ast_channel_walk_locked(c); } if (havepattern) |