mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
prevMissing searches in the wrong direction.
This commit is contained in:
@@ -78,7 +78,7 @@ uint32 RangeSet::getPrev (uint32 v) const
|
|||||||
uint32 RangeSet::prevMissing (uint32 v) const
|
uint32 RangeSet::prevMissing (uint32 v) const
|
||||||
{
|
{
|
||||||
// largest number not in the set that is less than the given number
|
// largest number not in the set that is less than the given number
|
||||||
BOOST_FOREACH (const value_type & it, mRanges)
|
BOOST_REVERSE_FOREACH (const value_type & it, mRanges)
|
||||||
{
|
{
|
||||||
if (contains (it, v))
|
if (contains (it, v))
|
||||||
return (it.first == 0) ? absent : (it.first - 1);
|
return (it.first == 0) ? absent : (it.first - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user