aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_devstate.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-11 15:25:43 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-11 15:25:43 +0000
commitf63dc635a4254728faa8f122255d07d24cc8522d (patch)
tree2ca15fcdea4312291aa40d6acfc99cd9ba283c5f /funcs/func_devstate.c
parentaf71df73fb849d9a51ad5b5569e693873cc9524e (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.c4
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);