Make sure the enumerator stops after all items have been enumerated.

This also changes how insert_before behaves, before enumeration items
are inserted first, after enumeration last.
This commit is contained in:
Tobias Brunner
2011-07-06 09:43:46 +02:00
parent c225f9b558
commit 2bf9d39da6
2 changed files with 23 additions and 4 deletions
+4 -3
View File
@@ -95,9 +95,10 @@ struct linked_list_t {
/**
* Inserts a new item before the item the enumerator currently points to.
*
* If the enumerator's position is invalid, e.g. at the end of the list,
* the item is inserted last. This is helpful when inserting items into a
* sorted list.
* If this method is called before starting the enumeration the item is
* inserted first. If it is called after all items have been enumerated
* the item is inserted last. This is helpful when inserting items into
* a sorted list.
*
* @note The position of the enumerator is not changed.
*