diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-11 15:25:43 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-11 15:25:43 +0000 |
commit | f63dc635a4254728faa8f122255d07d24cc8522d (patch) | |
tree | 2ca15fcdea4312291aa40d6acfc99cd9ba283c5f /funcs/func_devstate.c | |
parent | af71df73fb849d9a51ad5b5569e693873cc9524e (diff) |
Add a minor loop optimization to the custom device state callback. Once the
correct device is found, it should just break out of the loop ...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@61429 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_devstate.c')
-rw-r--r-- | funcs/func_devstate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/funcs/func_devstate.c b/funcs/func_devstate.c index c6429a853..6b0e7a3f9 100644 --- a/funcs/func_devstate.c +++ b/funcs/func_devstate.c @@ -99,8 +99,10 @@ static enum ast_device_state custom_devstate_callback(const char *data) AST_RWLIST_RDLOCK(&custom_devices); AST_RWLIST_TRAVERSE(&custom_devices, dev, entry) { - if (!strcasecmp(dev->name, data)) + if (!strcasecmp(dev->name, data)) { state = dev->state; + break; + } } AST_RWLIST_UNLOCK(&custom_devices); |