summaryrefslogtreecommitdiff
path: root/gtk/gtkcssanimatedstyle.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-01-11 08:51:04 +0100
committerAlexander Larsson <alexl@redhat.com>2017-01-11 09:20:30 +0100
commit882290b479c02f2bc6d1d3d85b09dc3cc66dc9b9 (patch)
tree07a5cad4e624cc7e31f909e53006f9732cc92969 /gtk/gtkcssanimatedstyle.c
parent249a0b1f22a9b7cb882c2d9ce18994a028025072 (diff)
downloadgtk+-882290b479c02f2bc6d1d3d85b09dc3cc66dc9b9.tar.gz
Skip dynamic type check in css value getters
This gets called a lot during snapshotting, and this change alone brings down snapshot time by almost 10% in a syntethic snapshot test.
Diffstat (limited to 'gtk/gtkcssanimatedstyle.c')
-rw-r--r--gtk/gtkcssanimatedstyle.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkcssanimatedstyle.c b/gtk/gtkcssanimatedstyle.c
index 1e89088a6b..aadaf97173 100644
--- a/gtk/gtkcssanimatedstyle.c
+++ b/gtk/gtkcssanimatedstyle.c
@@ -44,7 +44,8 @@ static GtkCssValue *
gtk_css_animated_style_get_value (GtkCssStyle *style,
guint id)
{
- GtkCssAnimatedStyle *animated = GTK_CSS_ANIMATED_STYLE (style);
+ /* This is called a lot, so we avoid a dynamic type check here */
+ GtkCssAnimatedStyle *animated = (GtkCssAnimatedStyle *) style;
if (animated->animated_values &&
id < animated->animated_values->len &&
@@ -147,8 +148,6 @@ GtkCssValue *
gtk_css_animated_style_get_intrinsic_value (GtkCssAnimatedStyle *style,
guint id)
{
- gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (style), NULL);
-
return gtk_css_style_get_value (style->style, id);
}