cssnumbervalue: Move early-out code to GtkCssValue

These checks make sense for all css values.
This commit is contained in:
Timm Bäder 2020-01-14 15:37:30 +01:00
parent c9e972eecb
commit e448fc41f3
2 changed files with 3 additions and 6 deletions

View File

@ -115,12 +115,6 @@ gtk_css_number_value_transition (GtkCssValue *start,
{
GtkCssValue *result, *mul_start, *mul_end;
if (progress == 0)
return _gtk_css_value_ref (start);
if (progress == 1)
return _gtk_css_value_ref (end);
if (start == end)
return _gtk_css_value_ref (start);

View File

@ -266,6 +266,9 @@ _gtk_css_value_transition (GtkCssValue *start,
if (progress == 1)
return _gtk_css_value_ref (end);
if (start == end)
return _gtk_css_value_ref (start);
#ifdef CSS_VALUE_ACCOUNTING
get_accounting_data (start->class->type_name)->transitioned++;
#endif