containers icon indicating copy to clipboard operation
containers copied to clipboard

UnrolledList: item inserted at wrong location after a remove

Open dhananjays opened this issue 2 years ago • 0 comments

version(emsi_containers_unittest) unittest
{
    UnrolledList!int list;
    list.insert(4);
    list.insert(8);
    list.insert(12);
    list.remove(8);
    list.insert(16);

    assert(list.back == 12);   // This assert succeeds, when it should have failed
    assert(list.back == 16);   // This assert fails, when it should have succeeded
}

The bug is in Node.nextAvailableIndex

dhananjays avatar Feb 18 '22 11:02 dhananjays