|
if ((elem)->previous != NULL) (elem)->previous->next = (elem);\ |
Hi!
Would like to suggest a change. (bugfix)
After the indicated line above, there should be the line:
(place) = (elem)\
This allows consecutive use of sglib_type_add_before(dllist_first), in the corner case where the dllist_first is NULL to begin with.
Current solution results in keeping the dllist_first pointer value the same as first call and place all new entries behind this first one which is continuously is moving further away from the 'front'.
Hence, new entries are placed at length-2 position!
This change fixed it. I can also push the change for review, if you like.
I am only working with the doubly ended linked list.
Best regards
sglib/sglib.h
Line 554 in 1d17ed7
Hi!
Would like to suggest a change. (bugfix)
After the indicated line above, there should be the line:
(place) = (elem)\
This allows consecutive use of sglib_type_add_before(dllist_first), in the corner case where the dllist_first is NULL to begin with.
Current solution results in keeping the dllist_first pointer value the same as first call and place all new entries behind this first one which is continuously is moving further away from the 'front'.
Hence, new entries are placed at length-2 position!
This change fixed it. I can also push the change for review, if you like.
I am only working with the doubly ended linked list.
Best regards