[evolution-data-server] Simplify e_contact_attr_list_copy().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Simplify e_contact_attr_list_copy().
- Date: Sat, 24 Nov 2012 02:13:48 +0000 (UTC)
commit a5d04ebc265ae146bad38c2602054dc9fe6f2314
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Nov 23 21:11:26 2012 -0500
Simplify e_contact_attr_list_copy().
g_list_copy_deep() makes it a one-liner.
addressbook/libebook/e-contact.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index 349dae2..96f54d3 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -2607,15 +2607,7 @@ E_CONTACT_DEFINE_BOXED_TYPE (e_contact_cert, "EContactCert")
GList *
e_contact_attr_list_copy (GList *list)
{
- GList *dup_list = NULL, *l;
-
- for (l = list; l; l = l->next) {
- gchar *str = g_strdup ((gchar *)l->data);
-
- dup_list = g_list_prepend (dup_list, str);
- }
-
- return g_list_reverse (dup_list);
+ return g_list_copy_deep (list, (GCopyFunc) g_strdup, NULL);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]