diff options
author | Alexander Larsson <alexl@redhat.com> | 2017-01-11 08:51:04 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2017-01-11 09:20:30 +0100 |
commit | 882290b479c02f2bc6d1d3d85b09dc3cc66dc9b9 (patch) | |
tree | 07a5cad4e624cc7e31f909e53006f9732cc92969 /gtk/gtkcssstaticstyle.c | |
parent | 249a0b1f22a9b7cb882c2d9ce18994a028025072 (diff) | |
download | gtk+-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/gtkcssstaticstyle.c')
-rw-r--r-- | gtk/gtkcssstaticstyle.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c index 217bb06265..f8ce97003d 100644 --- a/gtk/gtkcssstaticstyle.c +++ b/gtk/gtkcssstaticstyle.c @@ -44,7 +44,8 @@ static GtkCssValue * gtk_css_static_style_get_value (GtkCssStyle *style, guint id) { - GtkCssStaticStyle *sstyle = GTK_CSS_STATIC_STYLE (style); + /* This is called a lot, so we avoid a dynamic type check here */ + GtkCssStaticStyle *sstyle = (GtkCssStaticStyle *) style; return sstyle->values[id]; } |