Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcc81e3c authored by Colin Cross's avatar Colin Cross Committed by Android Git Automerger
Browse files

am 184eecf0: am 4ecbda41: Merge "Add list_add_head to libcutils"

* commit '184eecf0':
  Add list_add_head to libcutils
parents c34598aa 184eecf0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;