]> git.ipfire.org Git - thirdparty/strongswan.git/commit
linked-list: Order of insert_before/remove_at calls doesn't matter anymore
authorTobias Brunner <tobias@strongswan.org>
Mon, 28 May 2018 17:09:02 +0000 (19:09 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 26 Jun 2018 13:11:02 +0000 (15:11 +0200)
commit2c02b025896ce6eb059d148af43bf5de80ed8d8d
treeaac35c89581c4345d69990d9bcd33babff4cbf86
parent91640baf6dd55cd62b0184348a7bc76522a29264
linked-list: Order of insert_before/remove_at calls doesn't matter anymore

This was quite confusing previously:  While calling insert_before()
and then remove_at() properly replaced the current item, calling them the
other way around inserted the new item before the previous item because
remove_at() changed the enumerator's position to the previous item.

The behavior in corner cases (calling the methods before or after
enumeration) is also changed slightly.
src/libstrongswan/collections/linked_list.c
src/libstrongswan/collections/linked_list.h
src/libstrongswan/tests/suites/test_linked_list_enumerator.c