array: Number of items in get_size() is unsigned
[strongswan.git] / src / libstrongswan / collections / linked_list.c
index 4feb66f..a176e5a 100644 (file)
@@ -138,7 +138,10 @@ METHOD(enumerator_t, enumerate, bool,
                this->finished = TRUE;
                return FALSE;
        }
-       *item = this->current->value;
+       if (item)
+       {
+               *item = this->current->value;
+       }
        return TRUE;
 }
 
@@ -165,16 +168,6 @@ METHOD(linked_list_t, reset_enumerator, void,
        enumerator->finished = FALSE;
 }
 
-METHOD(linked_list_t, has_more, bool,
-       private_linked_list_t *this, private_enumerator_t *enumerator)
-{
-       if (enumerator->current)
-       {
-               return enumerator->current->next != NULL;
-       }
-       return !enumerator->finished && this->first != NULL;
-}
-
 METHOD(linked_list_t, get_count, int,
        private_linked_list_t *this)
 {
@@ -440,21 +433,6 @@ METHOD(linked_list_t, clone_offset, linked_list_t*,
        return clone;
 }
 
-METHOD(linked_list_t, clone_function, linked_list_t*,
-       private_linked_list_t *this, void* (*fn)(void*))
-{
-       element_t *current = this->first;
-       linked_list_t *clone;
-
-       clone = linked_list_create();
-       while (current)
-       {
-               clone->insert_last(clone, fn(current->value));
-               current = current->next;
-       }
-       return clone;
-}
-
 METHOD(linked_list_t, destroy, void,
        private_linked_list_t *this)
 {
@@ -512,7 +490,6 @@ linked_list_t *linked_list_create()
                        .get_count = _get_count,
                        .create_enumerator = _create_enumerator,
                        .reset_enumerator = (void*)_reset_enumerator,
-                       .has_more = (void*)_has_more,
                        .get_first = _get_first,
                        .get_last = _get_last,
                        .find_first = (void*)_find_first,
@@ -526,7 +503,6 @@ linked_list_t *linked_list_create()
                        .invoke_offset = (void*)_invoke_offset,
                        .invoke_function = (void*)_invoke_function,
                        .clone_offset = _clone_offset,
-                       .clone_function = _clone_function,
                        .destroy = _destroy,
                        .destroy_offset = _destroy_offset,
                        .destroy_function = _destroy_function,