[asterisk-commits] kpfleming: trunk r89118 - /trunk/channels/chan_features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 8 14:39:42 CST 2007


Author: kpfleming
Date: Thu Nov  8 14:39:41 2007
New Revision: 89118

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89118
Log:
convert this code to a more efficient idiom

Modified:
    trunk/channels/chan_features.c

Modified: trunk/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_features.c?view=diff&rev=89118&r1=89117&r2=89118
==============================================================================
--- trunk/channels/chan_features.c (original)
+++ trunk/channels/chan_features.c Thu Nov  8 14:39:41 2007
@@ -568,13 +568,11 @@
 	if (!AST_LIST_LOCK(&features))
 		return -1;
 	/* Hangup all interfaces if they have an owner */
-	AST_LIST_TRAVERSE_SAFE_BEGIN(&features, p, list) {
+	while ((p = AST_LIST_REMOVE_HEAD(&features, list))) {
 		if (p->owner)
 			ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
-		AST_LIST_REMOVE_CURRENT(list);
 		ast_free(p);
 	}
-	AST_LIST_TRAVERSE_SAFE_END
 	AST_LIST_UNLOCK(&features);
 	
 	return 0;




More information about the asterisk-commits mailing list