forked from AuroraMiddleware/gtk
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:
parent
5d86d209e9
commit
abed139a59
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user