diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-06-06 02:29:18 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-06-06 02:29:18 +0000 |
commit | 1bac31d6bdcde7988dab684f053cc8fe5fafed41 (patch) | |
tree | be967c9ab3099202d13219196b5f17284a939e78 /apps/app_groupcount.c | |
parent | bccc1171f049c459bd987d009a2f984e5aec4a8e (diff) |
more efficient (and understandable) ast_channel_walk_locked, and vastly more efficient ast_channel_by_name_locked (bug #4265)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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) |