A for loops seems easier to understand to me than gotos.
for (slist = nqueue->pspecs; slist; slist = slist->next)
{
GParamSpec *pspec = slist->data;
for (slist = nqueue->pspecs; slist; slist = slist->next)
{
GParamSpec *pspec = slist->data;
/* dedup, make pspecs in the list unique */
/* dedup, make pspecs in the list unique */
- redo_dedup_check:
- if (pspecs[i] == pspec)
- continue;
- if (++i < n_pspecs)
- goto redo_dedup_check;
-
- pspecs[n_pspecs++] = pspec;
+ for (i = 0; i < n_pspecs; i++)
+ {
+ if (pspecs[i] == pspec)
+ break;
+ }
+
+ if (i == n_pspecs) /* if no match was found */
+ 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);