aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_features.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-06 02:29:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-06 02:29:18 +0000
commit7b1b9f53ef47abd82c6faba12f4adcf721e622da (patch)
treebe967c9ab3099202d13219196b5f17284a939e78 /res/res_features.c
parentd39208dd35ce0ead92bf6a4b21361f3d13759589 (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 'res/res_features.c')
-rwxr-xr-xres/res_features.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/res/res_features.c b/res/res_features.c
index d6363e112..15546c040 100755
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -1661,10 +1661,9 @@ int load_module(void)
int ast_pickup_call(struct ast_channel *chan)
{
- struct ast_channel *cur;
+ struct ast_channel *cur = NULL;
int res = -1;
- cur = ast_channel_walk_locked(NULL);
- while(cur) {
+ while ( (cur = ast_channel_walk_locked(cur)) != NULL) {
if (!cur->pbx &&
(cur != chan) &&
(chan->pickupgroup & cur->callgroup) &&
@@ -1673,7 +1672,6 @@ int ast_pickup_call(struct ast_channel *chan)
break;
}
ast_mutex_unlock(&cur->lock);
- cur = ast_channel_walk_locked(cur);
}
if (cur) {
if (option_debug)