mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-22 20:56:39 +00:00 
			
		
		
		
	add a small optimization for deleting all the members of a list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@23271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -559,10 +559,8 @@ static int dundi_lookup_local(struct dundi_result *dr, struct dundi_mapping *map | |||||||
| 				newvariable = ast_var_assign("IPADDR", ipaddr); | 				newvariable = ast_var_assign("IPADDR", ipaddr); | ||||||
| 				AST_LIST_INSERT_HEAD(&headp, newvariable, entries); | 				AST_LIST_INSERT_HEAD(&headp, newvariable, entries); | ||||||
| 				pbx_substitute_variables_varshead(&headp, map->dest, dr[anscnt].dest, sizeof(dr[anscnt].dest)); | 				pbx_substitute_variables_varshead(&headp, map->dest, dr[anscnt].dest, sizeof(dr[anscnt].dest)); | ||||||
| 				while (!AST_LIST_EMPTY(&headp)) {           /* List Deletion. */ | 				while ((newvariable = AST_LIST_REMOVE_HEAD(&headp, entries))) | ||||||
| 					newvariable = AST_LIST_REMOVE_HEAD(&headp, entries); |  | ||||||
| 					ast_var_delete(newvariable); | 					ast_var_delete(newvariable); | ||||||
| 				} |  | ||||||
| 			} else | 			} else | ||||||
| 				dr[anscnt].dest[0] = '\0'; | 				dr[anscnt].dest[0] = '\0'; | ||||||
| 			anscnt++; | 			anscnt++; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user