Skip to content
Commit 93f29987 authored by Philip Withnall's avatar Philip Withnall
Browse files

glist: Mention that g_list_length() is bad for checking list emptiness

Despite linked lists being a fairly fundamental computer science
concept, some developers insist on using:
    g_list_length (list) > 0
to determine whether a list is non-empty, rather than using:
    list != NULL

Add a comment to the documentation for g_list_length() and
g_slist_length() pointing out the better alternative in the hope that it
will prevent some of this abuse.

https://bugzilla.gnome.org/show_bug.cgi?id=741024
parent 926955f3
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