mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
util: fix list_is_singular()
Currently its dependant on the user calling and checking the result of list_empty() before using the result of list_is_singular(). Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
5857858aa6
commit
0252ba26c5
1 changed files with 1 additions and 1 deletions
|
|
@ -110,7 +110,7 @@ static inline bool list_empty(struct list_head *list)
|
|||
*/
|
||||
static inline bool list_is_singular(const struct list_head *list)
|
||||
{
|
||||
return list->next != NULL && list->next->next == list;
|
||||
return list->next != NULL && list->next != list && list->next->next == list;
|
||||
}
|
||||
|
||||
static inline unsigned list_length(struct list_head *list)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue