diff --git a/glib/gslist.c b/glib/gslist.c index 8d32d05e2..1b047ec4a 100644 --- a/glib/gslist.c +++ b/glib/gslist.c @@ -515,6 +515,12 @@ _g_slist_remove_link (GSList *list, * link is set to %NULL, so that it becomes a * self-contained list with one element. * + * Removing arbitrary nodes from a singly-linked list + * requires time that is proportional to the length of the list + * (ie. O(n)). If you find yourself using g_slist_remove_link() + * frequently, you should consider a different data structure, such + * as the doubly-linked #GList. + * * Returns: the new start of the #GSList, without the element */ GSList* @@ -533,6 +539,12 @@ g_slist_remove_link (GSList *list, * Compare this to g_slist_remove_link() which removes the node * without freeing it. * + * Removing arbitrary nodes from a singly-linked list + * requires time that is proportional to the length of the list + * (ie. O(n)). If you find yourself using g_slist_delete_link() + * frequently, you should consider a different data structure, such + * as the doubly-linked #GList. + * * Returns: the new head of @list */ GSList*