Commit 3724592e authored by Christian Hergert's avatar Christian Hergert

listbox: short-circuit if no sort function is set

do_sort will crash if sort_func is not defined. Instead of adding a check
there in the hot path, just check for sort_func before invalidating the
sort of the underlying GSequence.
parent 49bd5a97
......@@ -1280,6 +1280,9 @@ gtk_list_box_invalidate_sort (GtkListBox *box)
g_return_if_fail (GTK_IS_LIST_BOX (box));
if (priv->sort_func == NULL)
g_sequence_sort (priv->children, (GCompareDataFunc)do_sort, box);
g_sequence_foreach (priv->children, gtk_list_box_css_node_foreach, &previous);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment