mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
Merge pull request #2906 from 9rnsr/fix_impurecall
Use debug instead of version
This commit is contained in:
commit
e453ecec38
1 changed files with 9 additions and 9 deletions
|
@ -24,9 +24,9 @@ import std.functional; // : binaryFun;
|
||||||
|
|
||||||
public import std.container.util;
|
public import std.container.util;
|
||||||
|
|
||||||
version(unittest) version = RBDoChecks;
|
version(unittest) debug = RBDoChecks;
|
||||||
|
|
||||||
//version = RBDoChecks;
|
//debug = RBDoChecks;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation for a Red Black node for use in a Red Black Tree (see below)
|
* Implementation for a Red Black node for use in a Red Black Tree (see below)
|
||||||
|
@ -694,7 +694,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
|
||||||
static if(allowDuplicates)
|
static if(allowDuplicates)
|
||||||
{
|
{
|
||||||
result.setColor(_end);
|
result.setColor(_end);
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
check();
|
check();
|
||||||
++_length;
|
++_length;
|
||||||
return result;
|
return result;
|
||||||
|
@ -708,7 +708,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
|
||||||
++_length;
|
++_length;
|
||||||
result.setColor(_end);
|
result.setColor(_end);
|
||||||
}
|
}
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
check();
|
check();
|
||||||
return Tuple!(bool, "added", Node, "n")(added, result);
|
return Tuple!(bool, "added", Node, "n")(added, result);
|
||||||
}
|
}
|
||||||
|
@ -1138,7 +1138,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
|
||||||
auto n = _begin;
|
auto n = _begin;
|
||||||
auto result = n.value;
|
auto result = n.value;
|
||||||
_begin = n.remove(_end);
|
_begin = n.remove(_end);
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
check();
|
check();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1165,7 +1165,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
|
||||||
scope(success)
|
scope(success)
|
||||||
--_length;
|
--_length;
|
||||||
_begin = _begin.remove(_end);
|
_begin = _begin.remove(_end);
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
check();
|
check();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1183,7 +1183,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
|
||||||
_begin = _begin.remove(_end);
|
_begin = _begin.remove(_end);
|
||||||
else
|
else
|
||||||
lastnode.remove(_end);
|
lastnode.remove(_end);
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
check();
|
check();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1223,7 +1223,7 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
|
||||||
b = b.remove(_end);
|
b = b.remove(_end);
|
||||||
--_length;
|
--_length;
|
||||||
}
|
}
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
check();
|
check();
|
||||||
return Range(e, _end);
|
return Range(e, _end);
|
||||||
}
|
}
|
||||||
|
@ -1522,7 +1522,7 @@ assert(equal(rbt[], [5]));
|
||||||
assert(equal(re, [3]));
|
assert(equal(re, [3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
version(RBDoChecks)
|
debug(RBDoChecks)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Print the tree. This prints a sideways view of the tree in ASCII form,
|
* Print the tree. This prints a sideways view of the tree in ASCII form,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue