changeset 11703:a53cef8bd22b

[gaim-migrate @ 13994] Change some g_list_append()s to g_list_prepend()s, since the list is sorted later either way. Also, change the order of arguments to a couple g_list_concat()s to cut down on the number of list elements to walk. These changes may improve performance a bit if you have a lot of logs. They certainly don't make the code more confusing or uglier, so I didn't see much harm. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 20 Oct 2005 17:11:56 +0000
parents 994f1c7bee8b
children 96a9462583c1
files src/gtklog.c src/log.c
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtklog.c	Thu Oct 20 16:50:00 2005 +0000
+++ b/src/gtklog.c	Thu Oct 20 17:11:56 2005 +0000
@@ -521,9 +521,8 @@
 		if (!GAIM_BLIST_NODE_IS_BUDDY(child))
 			continue;
 
-		logs = g_list_concat(logs,
-			gaim_log_get_logs(GAIM_LOG_IM, ((GaimBuddy *)child)->name,
-						((GaimBuddy *)child)->account));
+		logs = g_list_concat(gaim_log_get_logs(GAIM_LOG_IM, ((GaimBuddy *)child)->name,
+						((GaimBuddy *)child)->account), logs);
 		total_log_size += gaim_log_get_total_size(GAIM_LOG_IM, ((GaimBuddy *)child)->name, ((GaimBuddy *)child)->account);
 	}
 	logs = g_list_sort(logs, gaim_log_compare);
@@ -558,7 +557,7 @@
 		if(gaim_find_prpl(gaim_account_get_protocol_id(account)) == NULL)
 			continue;
 
-		logs = g_list_concat(logs, gaim_log_get_system_logs(account));
+		logs = g_list_concat(gaim_log_get_system_logs(account), logs);
 	}
 	logs = g_list_sort(logs, gaim_log_compare);
 
--- a/src/log.c	Thu Oct 20 16:50:00 2005 +0000
+++ b/src/log.c	Thu Oct 20 17:11:56 2005 +0000
@@ -376,7 +376,7 @@
 		GaimLogLogger *logger = n->data;
 		if (!logger->list)
 			continue;
-		logs = g_list_concat(logs, logger->list(type, name, account));
+		logs = g_list_concat(logger->list(type, name, account), logs);
 	}
 
 	return g_list_sort(logs, gaim_log_compare);
@@ -479,7 +479,7 @@
 		GaimLogLogger *logger = n->data;
 		if (!logger->list_syslog)
 			continue;
-		logs = g_list_concat(logs, logger->list_syslog(account));
+		logs = g_list_concat(logger->list_syslog(account), logs);
 	}
 
 	return g_list_sort(logs, gaim_log_compare);
@@ -614,7 +614,7 @@
 			log->logger = logger;
 			log->logger_data = data = g_new0(GaimLogCommonLoggerData, 1);
 			data->path = g_build_filename(path, filename, NULL);
-			list = g_list_append(list, log);
+			list = g_list_prepend(list, log);
 		}
 	}
 	g_dir_close(dir);
@@ -674,7 +674,7 @@
 			prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
 
 			if (!strcmp(protocol_unescaped, prpl_info->list_icon((GaimAccount *)account_iter->data, NULL)))
-				accounts = g_list_append(accounts, account_iter->data);
+				accounts = g_list_prepend(accounts, account_iter->data);
 		}
 		g_free(protocol_unescaped);
 
@@ -1168,7 +1168,7 @@
 					data->length = newlen;
 					data->pathref = gaim_stringref_ref(pathref);
 					log->logger_data = data;
-					list = g_list_append(list, log);
+					list = g_list_prepend(list, log);
 				}
 			}
 
@@ -1219,7 +1219,7 @@
 			data->length = newlen;
 			data->pathref = gaim_stringref_ref(pathref);
 			log->logger_data = data;
-			list = g_list_append(list, log);
+			list = g_list_prepend(list, log);
 		}
 	}