Removed unneeded and confusing insert_after method from linked_list_t.

This commit is contained in:
Tobias Brunner
2011-07-06 09:43:46 +02:00
parent 47daa0e6fe
commit 203497d80e
2 changed files with 6 additions and 25 deletions
-8
View File
@@ -475,13 +475,6 @@ METHOD(linked_list_t, insert_before, void,
insert_item_before(this, enumerator->current, item);
}
METHOD(linked_list_t, insert_after, void,
private_linked_list_t *this, private_enumerator_t *enumerator,
void *item)
{
insert_item_after(this, enumerator->current, item);
}
METHOD(linked_list_t, replace, void*,
private_linked_list_t *this, private_enumerator_t *enumerator,
void *item)
@@ -740,7 +733,6 @@ linked_list_t *linked_list_create()
.find_last = (void*)_find_last,
.insert_first = _insert_first,
.insert_last = _insert_last,
.insert_after = (void*)_insert_after,
.insert_before = (void*)_insert_before,
.replace = (void*)_replace,
.remove_first = _remove_first,
+6 -17
View File
@@ -77,8 +77,8 @@ struct linked_list_t {
/**
* Create an enumerator over the list.
*
* The enumerator is a "lightweight" iterator. It only has two methods
* and should therefore be much easier to implement.
* @note The enumerator's position is invalid before the first call
* to enumerate().
*
* @return enumerator over list items
*/
@@ -109,8 +109,11 @@ 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.
*
* @note The position of the enumerator is not changed.
* @note If the enumerator's position is invalid, the item is inserted last.
*
* @param enumerator enumerator with position
* @param item item value to insert in list
@@ -118,20 +121,6 @@ struct linked_list_t {
void (*insert_before)(linked_list_t *this, enumerator_t *enumerator,
void *item);
/**
* Inserts a new item after the item the enumerator currently points to.
*
* @note The position of the enumerator is not changed (thus the next item
* the enumerator returns will be the inserted item).
*
* @note If the enumerator's position is invalid, the item is inserted last.
*
* @param enumerator enumerator with position
* @param item item value to insert in list
*/
void (*insert_after)(linked_list_t *this, enumerator_t *enumerator,
void *item);
/**
* Replaces the item the enumerator currently points to with the given item.
*