stringlist: Make one constructor call the other

Simplifies code.
This commit is contained in:
Benjamin Otte 2020-06-30 19:35:04 +02:00
parent fb14f50ec1
commit a979daa8ea

View File

@ -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