summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilderparser.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-09-12 21:39:33 +0200
committerTimm Bäder <mail@baedert.org>2016-10-31 19:29:36 +0100
commite3a3a663700ffb0083576be60de57e49549eb622 (patch)
treed4b0356b5b261307e6556c6f3d012047072df825 /gtk/gtkbuilderparser.c
parentf415a8bc846fc635906b67b9dcb44259d2d48cbc (diff)
downloadgtk+-e3a3a663700ffb0083576be60de57e49549eb622.tar.gz
builderparser: Don't needlessly copy requested object names
Diffstat (limited to 'gtk/gtkbuilderparser.c')
-rw-r--r--gtk/gtkbuilderparser.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index 6fdef1c5f6..b4a9e9cbb8 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -221,11 +221,11 @@ static gboolean
is_requested_object (const gchar *object,
ParserData *data)
{
- GSList *l;
+ int i;
- for (l = data->requested_objects; l; l = l->next)
+ for (i = 0; data->requested_objects[i]; ++i)
{
- if (g_strcmp0 (l->data, object) == 0)
+ if (g_strcmp0 (data->requested_objects[i], object) == 0)
return TRUE;
}
@@ -1238,14 +1238,8 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
if (requested_objs)
{
- gint i;
-
data.inside_requested_object = FALSE;
- for (i = 0; requested_objs[i]; ++i)
- {
- data.requested_objects = g_slist_prepend (data.requested_objects,
- g_strdup (requested_objs[i]));
- }
+ data.requested_objects = requested_objs;
}
else
{
@@ -1295,7 +1289,6 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
g_slist_free_full (data.stack, (GDestroyNotify)free_info);
g_slist_free_full (data.custom_finalizers, (GDestroyNotify)free_subparser);
g_slist_free (data.finalizers);
- g_slist_free_full (data.requested_objects, g_free);
g_free (data.domain);
g_hash_table_destroy (data.object_ids);
g_markup_parse_context_free (data.ctx);