plf_list.remove() leaves an element stuck in the list
jdmairs opened this issue · 2 comments
jdmairs commented
Add the following test to plf_list_test_suite.cpp (remove ( ==5))
list1.remove(4)
failpass("should be empty list", 0 == list1.size())
Also replicated by:
plf::list<int*> x;
int a;
int b;
x.push_back(&a);
x.push_back(&b);
x.remove(&a);
x.remove(&b);
failpass("should be empty" 0 == x.size())
Love the list, we are seeing a 16% increase in performance. Luckily our own unittest alerted us to this problem.
mattreecebentley commented
Thanks! Always good to hear people finding it useful :) Will look into it
mattreecebentley commented
Wow - this was non-trivial. Same edge-case also affected a bunch of other functions - thanks