aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_dundi.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-29 04:13:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-29 04:13:07 +0000
commit8dc07ce85e30650caa8f54e614fe1543531cf16b (patch)
tree826dfc90b4534dc93a721fea2c1edfc86ef32e7e /pbx/pbx_dundi.c
parentdc64af46679f082413b9698ee10e0833b4681944 (diff)
add a small optimization for deleting all the members of a list
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23271 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r--pbx/pbx_dundi.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index ab9ba94db..044ddc4b2 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -559,10 +559,8 @@ static int dundi_lookup_local(struct dundi_result *dr, struct dundi_mapping *map
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++;