Commit graph

3 commits

Author SHA1 Message Date
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