Mercurial > pidgin.yaz
diff src/log.c @ 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 | a647f92e1d57 |
children | 52f27ffe68a5 |
line wrap: on
line diff
--- 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); } }