mirror of
https://github.com/dlang/phobos.git
synced 2025-05-09 13:02:30 +03:00
Remove version(assert) from TimSort
If `-debug` is passed to the compiler, `version(assert)` is true. TimSort has a `version(assert)` that checks some invariants, and uses std.format.format for better error messages. Unfortunately, since it is templated code, this results in Phobos template instantiations of `format` in the user's code when `-debug` is used. Given that default dub builds use `-debug`, this is a very common problem. Instead of removing the invariant checks, this changes it so they only happen when testing Phobos itself.
This commit is contained in:
parent
0300b493f4
commit
85aede0639
1 changed files with 1 additions and 1 deletions
|
@ -2332,7 +2332,7 @@ private template TimSortImpl(alias pred, R)
|
|||
}
|
||||
|
||||
// Assert that the code above established the invariant correctly
|
||||
version (assert)
|
||||
version (StdUnittest)
|
||||
{
|
||||
if (stackLen == 2)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue