Skip to content

Another bug in select iterators removed by simplification

Compare
Choose a tag to compare
@Cydhra Cydhra released this 28 Jun 20:05
· 18 commits to rel_1.3.2 since this release

The select iterators failed under certain conditions because they attempted to select bits from the limb that contained the last returned element, even if that limb does not contain any more set bits. This happened because the iterator forgot to account for popcounts in limbs preceding the current limb. The iterator now no longer keeps track of which limb contained the last selected bit, since searching the limb every time is essentially free due to caching effects.
Searching it every time forces the iterator to keep track of all bits, even if they are spread across multiple limbs in a block.