[gtk+/builder-details] Changed GtkComboBoxText <items> builder parser to use g_string_append_len().



commit db55f2e16d675099100b52c6f1b619ab6f409185
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Wed Jan 26 21:56:43 2011 +0900

    Changed GtkComboBoxText <items> builder parser to use g_string_append_len().

 gtk/gtkcomboboxtext.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkcomboboxtext.c b/gtk/gtkcomboboxtext.c
index c7a6da4..be0a076 100644
--- a/gtk/gtkcomboboxtext.c
+++ b/gtk/gtkcomboboxtext.c
@@ -206,14 +206,9 @@ item_text (GMarkupParseContext *context,
 	   GError             **error)
 {
   ItemParserData *data = (ItemParserData*)user_data;
-  gchar *string;
 
-  if (!data->is_text)
-    return;
-
-  string = g_strndup (text, text_len);
-  g_string_append (data->string, string);
-  g_free (string);
+  if (data->is_text)
+    g_string_append_len (data->string, text, text_len);
 }
 
 static void



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