[asterisk-commits] trunk r23271 - /trunk/pbx/pbx_dundi.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 28 21:13:09 MST 2006


Author: russell
Date: Fri Apr 28 23:13:07 2006
New Revision: 23271

URL: http://svn.digium.com/view/asterisk?rev=23271&view=rev
Log:
add a small optimization for deleting all the members of a list

Modified:
    trunk/pbx/pbx_dundi.c

Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?rev=23271&r1=23270&r2=23271&view=diff
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Fri Apr 28 23:13:07 2006
@@ -559,10 +559,8 @@
 				newvariable = ast_var_assign("IPADDR", ipaddr);
 				AST_LIST_INSERT_HEAD(&headp, newvariable, entries);
 				pbx_substitute_variables_varshead(&headp, map->dest, dr[anscnt].dest, sizeof(dr[anscnt].dest));
-				while (!AST_LIST_EMPTY(&headp)) {           /* List Deletion. */
-					newvariable = AST_LIST_REMOVE_HEAD(&headp, entries);
+				while ((newvariable = AST_LIST_REMOVE_HEAD(&headp, entries)))
 					ast_var_delete(newvariable);
-				}
 			} else
 				dr[anscnt].dest[0] = '\0';
 			anscnt++;



More information about the asterisk-commits mailing list