mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
notify: Make dedup code clearer
A for loops seems easier to understand to me than gotos.
This commit is contained in:
parent
9026b11e38
commit
0483ef000a
@ -124,15 +124,16 @@ g_object_notify_queue_thaw (GObject *object,
|
|||||||
for (slist = nqueue->pspecs; slist; slist = slist->next)
|
for (slist = nqueue->pspecs; slist; slist = slist->next)
|
||||||
{
|
{
|
||||||
GParamSpec *pspec = slist->data;
|
GParamSpec *pspec = slist->data;
|
||||||
guint i = 0;
|
guint i;
|
||||||
|
|
||||||
/* dedup, make pspecs in the list unique */
|
/* dedup, make pspecs in the list unique */
|
||||||
redo_dedup_check:
|
for (i = 0; i < n_pspecs; i++)
|
||||||
|
{
|
||||||
if (pspecs[i] == pspec)
|
if (pspecs[i] == pspec)
|
||||||
continue;
|
break;
|
||||||
if (++i < n_pspecs)
|
}
|
||||||
goto redo_dedup_check;
|
|
||||||
|
|
||||||
|
if (i == n_pspecs) /* if no match was found */
|
||||||
pspecs[n_pspecs++] = pspec;
|
pspecs[n_pspecs++] = pspec;
|
||||||
}
|
}
|
||||||
g_datalist_id_set_data (&object->qdata, context->quark_notify_queue, NULL);
|
g_datalist_id_set_data (&object->qdata, context->quark_notify_queue, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user