[pacman-dev] [PATCH] Simplify alpm_list_previous
Xavier Chantry
chantry.xavier at gmail.com
Mon Jul 4 03:28:13 EDT 2011
On Mon, Jul 4, 2011 at 4:16 AM, Allan McRae <allan at archlinux.org> wrote:
> We can readily detect the first node in a list by checking if
> node->prev->next is NULL. So there is no need to pass the head
> of the list to this function and its prototype now looks like
> all the other item accessors.
>
This works even for single item list where the first item is the last,
so node->prev == node.
ACK
More information about the pacman-dev
mailing list