[evolution-data-server] Simplify e_util_copy_string_slist().



commit 7846fa03f6b3dd330b1fa1dbae440ed985c9f497
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Jan 12 14:21:49 2013 -0500

    Simplify e_util_copy_string_slist().

 libedataserver/e-data-server-util.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index f907629..b17fdea 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -949,18 +949,12 @@ GSList *
 e_util_copy_string_slist (GSList *copy_to,
                           const GSList *strings)
 {
-	if (strings != NULL) {
-		const GSList *iter;
-		GSList *strings_copy = NULL;
-		/* Make deep copy of strings */
-		for (iter = strings; iter; iter = iter->next)
-			strings_copy = g_slist_prepend (strings_copy, g_strdup (iter->data));
+	GSList *copied_list;
 
-		/* Concatenate the two lists */
-		return g_slist_concat (copy_to, g_slist_reverse (strings_copy));
-	}
+	copied_list = g_slist_copy_deep (
+		(GSList *) copy_to, (GCopyFunc) g_strdup, NULL);
 
-	return copy_to;
+	return g_slist_concat (copy_to, copied_list);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]