[asterisk-commits] russell: trunk r61429 - /trunk/funcs/func_devstate.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 11 08:25:44 MST 2007


Author: russell
Date: Wed Apr 11 10:25:43 2007
New Revision: 61429

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61429
Log:
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 ...

Modified:
    trunk/funcs/func_devstate.c

Modified: trunk/funcs/func_devstate.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_devstate.c?view=diff&rev=61429&r1=61428&r2=61429
==============================================================================
--- trunk/funcs/func_devstate.c (original)
+++ trunk/funcs/func_devstate.c Wed Apr 11 10:25:43 2007
@@ -99,8 +99,10 @@
 
 	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);
 



More information about the asterisk-commits mailing list