cssbgsizevalue: Avoid allocating new value if not needed
This commit is contained in:
parent
6d953cb08e
commit
2fc0d6a91a
@ -60,6 +60,16 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
|
|||||||
if (value->y)
|
if (value->y)
|
||||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
|
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
|
||||||
|
|
||||||
|
if (x == value->x && y == value->y)
|
||||||
|
{
|
||||||
|
if (x)
|
||||||
|
_gtk_css_value_unref (x);
|
||||||
|
if (y)
|
||||||
|
_gtk_css_value_unref (y);
|
||||||
|
|
||||||
|
return _gtk_css_value_ref (value);
|
||||||
|
}
|
||||||
|
|
||||||
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
|
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
|
||||||
value->y ? y : NULL);
|
value->y ? y : NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user