Don't require a list_init() on a node before we can call list_remove on it, it clutters up the code for little benefit.
Signed-off-by: Peter Hutterer <[email protected]> --- src/libinput-util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libinput-util.c b/src/libinput-util.c index 3a9c8db..f19695c 100644 --- a/src/libinput-util.c +++ b/src/libinput-util.c @@ -59,6 +59,9 @@ list_insert(struct list *list, struct list *elm) void list_remove(struct list *elm) { + if (elm->next == NULL && elm->prev == NULL) + return; + elm->prev->next = elm->next; elm->next->prev = elm->prev; elm->next = NULL; -- 2.4.3 _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
