From a979daa8ea98e15e6c88f171707c187793c23b14 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 30 Jun 2020 19:35:04 +0200 Subject: [PATCH] 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