aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstrongswan/utils/iterator.h8
-rw-r--r--src/libstrongswan/utils/linked_list.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/src/libstrongswan/utils/iterator.h b/src/libstrongswan/utils/iterator.h
index 7cc22c24b..79e23ab3f 100644
--- a/src/libstrongswan/utils/iterator.h
+++ b/src/libstrongswan/utils/iterator.h
@@ -50,6 +50,7 @@ struct iterator_t {
* @return number of list items
*/
int (*get_count) (iterator_t *this);
+
/**
* @brief Iterate over all items.
*
@@ -125,10 +126,9 @@ struct iterator_t {
/**
* @brief Removes an element from list at the given iterator position.
*
- * The position of the iterator is set in the following order:
+ * The iterator is set the the following position:
* - to the item before, if available
- * - otherwise to the item after, if available
- * - otherwise it gets reseted
+ * - it gets reseted, otherwise
*
* @param linked_list calling object
* @return
@@ -136,7 +136,7 @@ struct iterator_t {
* - FAILED if iterator is on an invalid position
*/
status_t (*remove) (iterator_t *iterator);
-
+
/**
* @brief Resets the iterator position.
*
diff --git a/src/libstrongswan/utils/linked_list.c b/src/libstrongswan/utils/linked_list.c
index 2d2917454..6d5bace81 100644
--- a/src/libstrongswan/utils/linked_list.c
+++ b/src/libstrongswan/utils/linked_list.c
@@ -268,10 +268,6 @@ static status_t remove(private_iterator_t *this)
{
new_current = this->current->previous;
}
- else if (this->current->next != NULL)
- {
- new_current = this->current->next;
- }
else
{
new_current = NULL;