diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-09-10 22:04:31 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-09-12 12:50:37 -0400 |
commit | 20c49b883763c1a8d0097425cdfb1eaf1e4df190 (patch) | |
tree | da6853c61464fae86c1fe6f227e0ad658d1f63c2 /gtk/gtkcssnodedeclaration.c | |
parent | 29505af07fdf0950a5abd39d4e24d852ae242155 (diff) | |
download | gtk+-20c49b883763c1a8d0097425cdfb1eaf1e4df190.tar.gz |
css node declaration: Avoid optional out parameters
Always pass a pos to find_class, and avoid the if.
Diffstat (limited to 'gtk/gtkcssnodedeclaration.c')
-rw-r--r-- | gtk/gtkcssnodedeclaration.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gtk/gtkcssnodedeclaration.c b/gtk/gtkcssnodedeclaration.c index 87030d0f27..da1c944bd3 100644 --- a/gtk/gtkcssnodedeclaration.c +++ b/gtk/gtkcssnodedeclaration.c @@ -231,8 +231,7 @@ find_class (const GtkCssNodeDeclaration *decl, GQuark *classes; guint pos; - if (position) - *position = 0; + *position = 0; if (decl->n_classes == 0) return FALSE; @@ -264,8 +263,7 @@ find_class (const GtkCssNodeDeclaration *decl, } while (min <= max); - if (position) - *position = pos; + *position = pos; return found; } @@ -326,6 +324,7 @@ gboolean gtk_css_node_declaration_has_class (const GtkCssNodeDeclaration *decl, GQuark class_quark) { + guint pos; GQuark *classes = get_classes (decl); switch (decl->n_classes) @@ -346,7 +345,7 @@ gtk_css_node_declaration_has_class (const GtkCssNodeDeclaration *decl, return FALSE; default: - return find_class (decl, class_quark, NULL); + return find_class (decl, class_quark, &pos); } } |