css node declaration: Avoid optional out parameters
Always pass a pos to find_class, and avoid the if.
This commit is contained in:
@ -231,8 +231,7 @@ find_class (const GtkCssNodeDeclaration *decl,
|
|||||||
GQuark *classes;
|
GQuark *classes;
|
||||||
guint pos;
|
guint pos;
|
||||||
|
|
||||||
if (position)
|
*position = 0;
|
||||||
*position = 0;
|
|
||||||
|
|
||||||
if (decl->n_classes == 0)
|
if (decl->n_classes == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -264,8 +263,7 @@ find_class (const GtkCssNodeDeclaration *decl,
|
|||||||
}
|
}
|
||||||
while (min <= max);
|
while (min <= max);
|
||||||
|
|
||||||
if (position)
|
*position = pos;
|
||||||
*position = pos;
|
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
@ -326,6 +324,7 @@ gboolean
|
|||||||
gtk_css_node_declaration_has_class (const GtkCssNodeDeclaration *decl,
|
gtk_css_node_declaration_has_class (const GtkCssNodeDeclaration *decl,
|
||||||
GQuark class_quark)
|
GQuark class_quark)
|
||||||
{
|
{
|
||||||
|
guint pos;
|
||||||
GQuark *classes = get_classes (decl);
|
GQuark *classes = get_classes (decl);
|
||||||
|
|
||||||
switch (decl->n_classes)
|
switch (decl->n_classes)
|
||||||
@ -346,7 +345,7 @@ gtk_css_node_declaration_has_class (const GtkCssNodeDeclaration *decl,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return find_class (decl, class_quark, NULL);
|
return find_class (decl, class_quark, &pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user