g_[s]list_pop() ?




I've noticed that I pretty frequently do code like:

      GSList *tmp = drag_widgets;
      result = drag_widgets->data;
      drag_widgets = drag_widgets->next;
      g_slist_free_1 (tmp);

and I think it would be nice to have something
to make this easier.

Is:

  result = drag_widgets->data;
  drag_widgets = g_slist_pop (drag_widgets);
  
or:

  result = drag_widgets->data;
  drag_widgets = g_slist_delete_link (drag_widgets, drag_widgets);

better? Or should we have both?

                                    Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]