diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-09-09 00:38:48 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-09-09 06:32:47 -0400 |
commit | 0e86278fcc30613dab0358aa5d55a09afc5cb722 (patch) | |
tree | a698f698e7f11e3a38340385227ab917cc215926 /gtk/gtkcssselector.c | |
parent | c8072c89ba30ba32325cfc37180f7c5336d5a772 (diff) | |
download | gtk+-0e86278fcc30613dab0358aa5d55a09afc5cb722.tar.gz |
css selector: Use the quarks we have
Unless I'm missing something, there is no reason to go from
quarks back to strings to implement hasing or comparison.
Diffstat (limited to 'gtk/gtkcssselector.c')
-rw-r--r-- | gtk/gtkcssselector.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c index 6ad744c5f5..59e1404583 100644 --- a/gtk/gtkcssselector.c +++ b/gtk/gtkcssselector.c @@ -36,7 +36,7 @@ struct _GtkCssSelectorClass { void (* print) (const GtkCssSelector *selector, GString *string); /* NULL or an iterator that calls func with each submatcher of @matcher. - * Potentially no submatcher exissts. + * Potentially no submatcher exists. * If any @invocation of @func returns %TRUE, the function will immediately * return %TRUE itself. If @func never returns %TRUE (or isn't called at all), * %FALSE will be returned. @@ -798,15 +798,14 @@ match_class (const GtkCssSelector *selector, static guint hash_class (const GtkCssSelector *a) { - return g_str_hash (g_quark_to_string (a->style_class.style_class)); + return a->style_class.style_class; } static int comp_class (const GtkCssSelector *a, const GtkCssSelector *b) { - return strcmp (g_quark_to_string (a->style_class.style_class), - g_quark_to_string (b->style_class.style_class)); + return a->style_class.style_class - b->style_class.style_class; } DEFINE_SIMPLE_SELECTOR(class, CLASS, print_class, match_class, hash_class, comp_class, FALSE, TRUE, FALSE) |