Commit graph

5 commits

Author SHA1 Message Date
Aidan MacDonald
5e864ecde9 linked list: add lld_insert_prev/next()
Change-Id: I55ff061ccc0e6e2dad3125a8150c082c163db329
2022-10-16 16:10:24 +01:00
Aidan MacDonald
ee9679993b linked list: inline list init functions
These functions are so trivial it's always cheaper to inline them.

Change-Id: Ie0c77c8b6e7a716312105445a22e62ff57a76d90
2022-10-16 16:10:24 +01:00
Michael Sevakis
dbacee67c4 Optimize lld_remove() a bit
Just need to check prev and next for NULL to know whether to mess
with the head and/or tail pointers.

Change-Id: I0aee057111e11735b7806e7214af0a6038f0ab53
2017-04-13 18:59:45 -04:00
Michael Sevakis
077e20664c Improve the implementation of a couple linked list routines.
ll_insert_next() and ll_remove_next() can be done more elegantly
by adding a level of indirection to reference the 'next' pointer.

Change-Id: If3ab2bc2a659b517c793749cfa9088938ae08d0d
2017-01-07 21:14:32 -05:00
Michael Sevakis
eb63d8b4a2 Add common linked list functions
Forms implemented to a greater or lesser degree at the moment:
ll_*   = singly-linked list
lld_*  = doubly-linked list
lldc_* = doubly-linked circular list

Change-Id: Ieed5af50fc59165c8b14c3513b3b5d0e6f7de9fa
2014-08-16 00:27:01 -04:00