cssnode: Delay getting the parent style until we need it

There's an early return before.

Look at all those saved cycles.
This commit is contained in:
Timm Bäder 2017-10-10 21:54:53 +02:00
parent 5d86d209e9
commit abed139a59

View File

@ -361,12 +361,13 @@ gtk_css_node_create_style (GtkCssNode *cssnode)
GtkCssStyle *style;
decl = gtk_css_node_get_declaration (cssnode);
parent = cssnode->parent ? cssnode->parent->style : NULL;
style = lookup_in_global_parent_cache (cssnode, decl);
if (style)
return g_object_ref (style);
parent = cssnode->parent ? cssnode->parent->style : NULL;
if (gtk_css_node_init_matcher (cssnode, &matcher))
style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
&matcher,