am fcc81e3c: am 184eecf0: am 4ecbda41: Merge "Add list_add_head to libcutils"
* commit 'fcc81e3c6f0724b3b360b19071005e559334bc58': Add list_add_head to libcutils
This commit is contained in:
commit
795e59b32a
|
@ -63,6 +63,14 @@ static inline void list_add_tail(struct listnode *head, struct listnode *item)
|
|||
head->prev = item;
|
||||
}
|
||||
|
||||
static inline void list_add_head(struct listnode *head, struct listnode *item)
|
||||
{
|
||||
item->next = head->next;
|
||||
item->prev = head;
|
||||
head->next->prev = item;
|
||||
head->next = item;
|
||||
}
|
||||
|
||||
static inline void list_remove(struct listnode *item)
|
||||
{
|
||||
item->next->prev = item->prev;
|
||||
|
|
Loading…
Reference in New Issue