[gtk/wip/baedert/css-values: 87/102] cssnumbervalue: Move early-out code to GtkCssValue
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/css-values: 87/102] cssnumbervalue: Move early-out code to GtkCssValue
- Date: Sat, 18 Jan 2020 07:52:45 +0000 (UTC)
commit e448fc41f3d40666e7b09b6a3b3d16049cab80af
Author: Timm Bäder <mail baedert org>
Date: Tue Jan 14 15:37:30 2020 +0100
cssnumbervalue: Move early-out code to GtkCssValue
These checks make sense for all css values.
gtk/gtkcssnumbervalue.c | 6 ------
gtk/gtkcssvalue.c | 3 +++
2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c
index 83fa257f01..508ba35c99 100644
--- a/gtk/gtkcssnumbervalue.c
+++ b/gtk/gtkcssnumbervalue.c
@@ -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);
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c
index 88711c0f1e..f4a1b27d10 100644
--- a/gtk/gtkcssvalue.c
+++ b/gtk/gtkcssvalue.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]