Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.12.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandman83 committed Jul 8, 2019
2 parents bead281 + f242f11 commit df2e682
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions source/vebtree.d
Expand Up @@ -371,17 +371,15 @@ static foreach (_; 1 .. size_t.sizeof - 1)
assert(vT2.insert(rndNum), errorString);
}
assert(vT != vT2);
//auto vT3 = vT2;
//vT3.insert(rndNum);
//assert(rndNum in vT3);
//assert(rndNum in vT2);
//assert(vT2.length == vT3.length);
}

const rangeExclusive = vT();
assert(vT == rangeExclusive);

auto rangeInclusive = vT[];
import std.algorithm.comparison : equal;
import std.algorithm.iteration : uniq;
assert(equal(uniq(rangeInclusive), rangeInclusive));
import std.range : enumerate;
foreach(i, el; rangeInclusive.enumerate)
{
Expand Down Expand Up @@ -1215,31 +1213,15 @@ struct VEBtree(Flag!"inclusive" inclusive, T)
else
{
if(root.front > 0)
{
++length;
}

if(root.back <= root.universe)
{
backKey = root.universe;
++length;
}
backKey = root.universe;
else if(root.back <= root.capacity)
{
backKey = root.capacity;
++length;
}
else
{
debug
{
assert(root.back == root.universe || root.back == -1, format!"back: %d\n"(root.back));
}
else
{
assert(0);
}
}
backKey = root.capacity;

if(root.back < backKey)
++length;
}
}
else
Expand Down

0 comments on commit df2e682

Please sign in to comment.