mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
util/list: use helper function in list_is_singular
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>
This commit is contained in:
parent
a9bcb10ec4
commit
5f2166525f
1 changed files with 1 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ static inline bool list_is_linked(const struct list_head *list)
|
|||
*/
|
||||
static inline bool list_is_singular(const struct list_head *list)
|
||||
{
|
||||
return list_is_linked(list) && list->next != list && list->next->next == list;
|
||||
return list_is_linked(list) && !list_is_empty(list) && list->next->next == list;
|
||||
}
|
||||
|
||||
static inline unsigned list_length(const struct list_head *list)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue