summaryrefslogtreecommitdiff
path: root/gtk/gtktextviewchild.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-01-24 00:43:26 +0100
committerBenjamin Otte <otte@redhat.com>2020-01-28 02:17:03 +0100
commit146b9212462b8a8ba8eb5c162bc667fe5a792bb0 (patch)
treeb1b9088c9fe8a062da4d3f8b322987a5301e4c87 /gtk/gtktextviewchild.c
parent8b93ea9238bcbb99f6caadca9f6ef1d422926a35 (diff)
downloadgtk+-146b9212462b8a8ba8eb5c162bc667fe5a792bb0.tar.gz
cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that have their values close together, so they can fit in a smaller range (the goal here is 12 bits). By using GQuark, we get consecutive numbers starting with 1 (and applications have <1000 quarks usually), whereas interned strings can be all over the place. As a side effect we also save 64 bytes per declaration.
Diffstat (limited to 'gtk/gtktextviewchild.c')
-rw-r--r--gtk/gtktextviewchild.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtktextviewchild.c b/gtk/gtktextviewchild.c
index 062424d341..a51ddfe3ac 100644
--- a/gtk/gtktextviewchild.c
+++ b/gtk/gtktextviewchild.c
@@ -306,27 +306,27 @@ gtk_text_view_child_constructed (GObject *object)
switch (self->window_type)
{
case GTK_TEXT_WINDOW_LEFT:
- gtk_css_node_set_name (css_node, "border");
+ gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_LEFT));
break;
case GTK_TEXT_WINDOW_RIGHT:
- gtk_css_node_set_name (css_node, "border");
+ gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_RIGHT));
break;
case GTK_TEXT_WINDOW_TOP:
- gtk_css_node_set_name (css_node, "border");
+ gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_TOP));
break;
case GTK_TEXT_WINDOW_BOTTOM:
- gtk_css_node_set_name (css_node, "border");
+ gtk_css_node_set_name (css_node, g_quark_from_static_string ("border"));
gtk_css_node_add_class (css_node, g_quark_from_static_string (GTK_STYLE_CLASS_BOTTOM));
break;
case GTK_TEXT_WINDOW_TEXT:
- gtk_css_node_set_name (css_node, "text");
+ gtk_css_node_set_name (css_node, g_quark_from_static_string ("text"));
break;
case GTK_TEXT_WINDOW_WIDGET: