[gtk/wip/otte/for-master: 7/10] stringlist: Make one constructor call the other



commit 916f924c8cfc7a89b8365b3e45a1a877070a534c
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jun 30 19:35:04 2020 +0200

    stringlist: Make one constructor call the other
    
    Simplifies code.

 gtk/gtkstringlist.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkstringlist.c b/gtk/gtkstringlist.c
index 2b43f70e5d..70290fe24f 100644
--- a/gtk/gtkstringlist.c
+++ b/gtk/gtkstringlist.c
@@ -145,17 +145,6 @@ gtk_string_object_class_init (GtkStringObjectClass *class)
 
 }
 
-static GtkStringObject *
-gtk_string_object_new (const char *string)
-{
-  GtkStringObject *result;
-
-  result = g_object_new (GTK_TYPE_STRING_OBJECT, NULL);
-  result->string = g_strdup (string);
-
-  return result;
-}
-
 static GtkStringObject *
 gtk_string_object_new_take (char *string)
 {
@@ -167,6 +156,12 @@ gtk_string_object_new_take (char *string)
   return obj;
 }
 
+static GtkStringObject *
+gtk_string_object_new (const char *string)
+{
+  return gtk_string_object_new_take (g_strdup (string));
+}
+
 /**
  * gtk_string_object_get_string:
  * @self: a #GtkStringObject


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