Messages in this thread | | | From | Miklos Szeredi <> | Date | Thu, 26 Oct 2023 11:52:34 +0200 | Subject | Re: [RFC PATCH 1/2] add list_for_each_entry_del() |
| |
On Sat, Oct 21, 2023 at 12:00 PM David Laight <David.Laight@aculab.com> wrote:
> Adding a list_del_first() function that returns the deleted > item or NULL to optimise it might make more sense.
Something like this?
- list_for_each_entry_del(entry, head, member)) + while (list_del_first(entry, head, member))
This allows the compact loop condition, and I always hated having to pass the type to list_*entry()... Disadvantage being that the assignment is now implicit (just as with all the list iterators).
Thanks, Miklos
| |