[gtk/matthiasc/css-values: 14/23] css: Simplify compute for font features
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/css-values: 14/23] css: Simplify compute for font features
- Date: Fri, 10 Jan 2020 19:18:18 +0000 (UTC)
commit 65ef2f4507285e75a1cd5ecd0177252d8e4e94fd
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 10 01:27:49 2020 -0500
css: Simplify compute for font features
Font features consist of a hash table of number
values, which will never change during compute,
so there is no point in recreating a new value
with a copy of the hash table, constaining the
same string->number mapping.
gtk/gtkcssfontfeaturesvalue.c | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
---
diff --git a/gtk/gtkcssfontfeaturesvalue.c b/gtk/gtkcssfontfeaturesvalue.c
index 12eb2bed1a..0a99715094 100644
--- a/gtk/gtkcssfontfeaturesvalue.c
+++ b/gtk/gtkcssfontfeaturesvalue.c
@@ -57,29 +57,7 @@ gtk_css_value_font_features_compute (GtkCssValue *specified,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
- GHashTableIter iter;
- gpointer name, val;
- GtkCssValue *computed_val;
- GtkCssValue *result;
- gboolean changes = FALSE;
-
- result = gtk_css_font_features_value_new_empty ();
-
- g_hash_table_iter_init (&iter, specified->features);
- while (g_hash_table_iter_next (&iter, &name, &val))
- {
- computed_val = _gtk_css_value_compute (val, property_id, provider, style, parent_style);
- changes |= computed_val != val;
- gtk_css_font_features_value_add_feature (result, name, computed_val);
- }
-
- if (!changes)
- {
- _gtk_css_value_unref (result);
- result = _gtk_css_value_ref (specified);
- }
-
- return result;
+ return _gtk_css_value_ref (specified);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]