patch for address-book-vcard
- From: Emmanuel <e allaud wanadoo fr>
- To: balsa-list gnome org
- Subject: patch for address-book-vcard
- Date: Tue, 19 Jun 2001 09:11:21 +0200
Hi all,
First part of the patch : just speed improvement;
Second part :
can someone explain me why we reverse completion_list after his creation
instead of create it just in the right direction in this chunk of code
(in libbalsa/address-book-vcard.c) ? :
completion_list = NULL;
while ( list ) {
cmp_data = completion_data_new(LIBBALSA_ADDRESS(list->data),
FALSE);
completion_list = g_list_prepend(completion_list, cmp_data);
list = g_list_next(list);
}
completion_list = g_list_reverse(completion_list);
If there is no good reason you can apply the second part of the
straightforward patch I've attached.
Bye
Manu
--- address-book-vcard.c Wed Mar 21 18:17:52 2001
+++ address-book-vcard.c.corr Tue Jun 19 09:09:03 2001
@@ -209,11 +209,11 @@
load_vcard_file(ab);
lst = LIBBALSA_ADDRESS_BOOK_VCARD(ab)->address_list;
- while (lst) {
- if ( callback )
+ if (callback)
+ while (lst) {
callback(ab, LIBBALSA_ADDRESS(lst->data), closure);
- lst = g_list_next(lst);
- }
+ lst = g_list_next(lst);
+ }
callback(ab, NULL, closure);
}
@@ -331,10 +331,9 @@
completion_list = NULL;
while ( list ) {
cmp_data = completion_data_new(LIBBALSA_ADDRESS(list->data), FALSE);
- completion_list = g_list_prepend(completion_list, cmp_data);
+ completion_list = g_list_append(completion_list, cmp_data);
list = g_list_next(list);
}
- completion_list = g_list_reverse(completion_list);
g_completion_add_items(addr_vcard->name_complete, completion_list);
g_list_free(completion_list);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]