masqmail

changeset 343:9149d893eb52

refactoring: ``insourced'' create_msg_out_list() The function is only four lines and used only once. It's simpler to have the four lines just at the actual place.
author markus schnalke <meillo@marmaro.de>
date Sat, 03 Sep 2011 18:25:02 +0200
parents 3f1eecd8082d
children 0410c8aabac2
files src/deliver.c src/masqmail.h src/message.c
diffstat 3 files changed, 9 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/src/deliver.c	Wed Aug 31 09:39:40 2011 +0200
     1.2 +++ b/src/deliver.c	Sat Sep 03 18:25:02 2011 +0200
     1.3 @@ -729,7 +729,8 @@
     1.4  gboolean
     1.5  deliver_msg_list(GList * msg_list, guint flags)
     1.6  {
     1.7 -	GList *msgout_list = create_msg_out_list(msg_list);
     1.8 +	GList *msgout_list = NULL;
     1.9 +	GList *msg_node;
    1.10  	GList *local_msgout_list = NULL;
    1.11  	GList *localnet_msgout_list = NULL;
    1.12  	GList *other_msgout_list = NULL;
    1.13 @@ -737,6 +738,13 @@
    1.14  	GList *alias_table = NULL;
    1.15  	gboolean ok = TRUE;
    1.16  
    1.17 +	/* create msgout_list */
    1.18 +	foreach(msg_list, msg_node) {
    1.19 +		message *msg = (message *) msg_node->data;
    1.20 +		msgout_list = g_list_append(msgout_list, create_msg_out(msg));
    1.21 +	}
    1.22 +
    1.23 +
    1.24  	if (conf.alias_file) {
    1.25  		alias_table = table_read(conf.alias_file, ':');
    1.26  	}
     2.1 --- a/src/masqmail.h	Wed Aug 31 09:39:40 2011 +0200
     2.2 +++ b/src/masqmail.h	Sat Sep 03 18:25:02 2011 +0200
     2.3 @@ -365,7 +365,6 @@
     2.4  
     2.5  msg_out *create_msg_out(message * msg);
     2.6  msg_out *clone_msg_out(msg_out * msgout_orig);
     2.7 -GList *create_msg_out_list(GList * msg_list);
     2.8  void destroy_msg_out(msg_out * msgout);
     2.9  void destroy_msg_out_list(GList * msgout_list);
    2.10  
     3.1 --- a/src/message.c	Wed Aug 31 09:39:40 2011 +0200
     3.2 +++ b/src/message.c	Sat Sep 03 18:25:02 2011 +0200
     3.3 @@ -200,19 +200,6 @@
     3.4  	return NULL;
     3.5  }
     3.6  
     3.7 -GList*
     3.8 -create_msg_out_list(GList * msg_list)
     3.9 -{
    3.10 -	GList *msgout_list = NULL;
    3.11 -	GList *msg_node;
    3.12 -
    3.13 -	foreach(msg_list, msg_node) {
    3.14 -		message *msg = (message *) (msg_node->data);
    3.15 -		msgout_list = g_list_append(msgout_list, create_msg_out(msg));
    3.16 -	}
    3.17 -	return msgout_list;
    3.18 -}
    3.19 -
    3.20  void
    3.21  destroy_msg_out(msg_out * msgout)
    3.22  {