diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-09-08 20:24:29 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-09-09 06:32:45 -0400 |
commit | 96d66a11cfe3914883a32fff8941f23f624527b4 (patch) | |
tree | a651aeea86367428405499cedf7db70d8c6cc36f /gtk | |
parent | 389ae3e0226533680acf67c6f62d3c3bdee1e4e2 (diff) | |
download | gtk+-96d66a11cfe3914883a32fff8941f23f624527b4.tar.gz |
builder: Avoid some type-checking overhead
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkbuilder.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index b149b9a90b..323a3e0915 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -480,7 +480,8 @@ gtk_builder_get_parameters (GtkBuilder *builder, if (G_IS_PARAM_SPEC_OBJECT (prop->pspec) && (G_PARAM_SPEC_VALUE_TYPE (prop->pspec) != GDK_TYPE_PIXBUF)) { - GObject *object = gtk_builder_get_object (builder, prop->text->str); + GObject *object = g_hash_table_lookup (builder->priv->objects, + prop->text->str); if (object) { @@ -667,7 +668,7 @@ _gtk_builder_construct (GtkBuilder *builder, { GObject *constructor; - constructor = gtk_builder_get_object (builder, info->constructor); + constructor = g_hash_table_lookup (builder->priv->objects, info->constructor); if (constructor == NULL) { g_set_error (error, @@ -1540,7 +1541,7 @@ gtk_builder_expose_object (GtkBuilder *builder, { g_return_if_fail (GTK_IS_BUILDER (builder)); g_return_if_fail (name && name[0]); - g_return_if_fail (gtk_builder_get_object (builder, name) == NULL); + g_return_if_fail (!g_hash_table_contains (builder->priv->objects, name)); object_set_name (object, name); g_hash_table_insert (builder->priv->objects, @@ -1845,7 +1846,6 @@ gtk_builder_value_from_string_type (GtkBuilder *builder, { gboolean ret = TRUE; - g_return_val_if_fail (type != G_TYPE_INVALID, FALSE); g_return_val_if_fail (string != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -2041,7 +2041,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS GError *tmp_error = NULL; GdkPixbuf *pixbuf = NULL; - if (gtk_builder_get_object (builder, string)) + if (g_hash_table_contains (builder->priv->objects, string)) { g_set_error (error, GTK_BUILDER_ERROR, |