From: Matthias Clasen Date: Fri, 10 Jan 2020 06:27:49 +0000 (-0500) Subject: css: Simplify compute for font features X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~356^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=898e29c98929ddfbcc6cff2158f06fe9dc4e9352;p=gtk4.git 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. --- diff --git a/gtk/gtkcssfontfeaturesvalue.c b/gtk/gtkcssfontfeaturesvalue.c index 67110a878c..1f1b3e030b 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