Remove std.conv import from quickSortImpl

This commit is contained in:
0-v-0 2024-06-22 11:07:40 +08:00
parent 42e2caa5c0
commit d8e8f1f351
2 changed files with 8 additions and 7 deletions

View file

@ -2164,12 +2164,12 @@ private void quickSortImpl(alias less, Range)(Range r, size_t depth)
{
import std.algorithm.comparison : min, max;
import std.algorithm.mutation : swap, swapAt;
import std.conv : to;
alias Elem = ElementType!(Range);
enum size_t shortSortGetsBetter = max(32, 1024 / Elem.sizeof);
enum int size = Elem.sizeof;
enum size_t shortSortGetsBetter = max(32, 1024 / size);
static assert(shortSortGetsBetter >= 1, Elem.stringof ~ " "
~ to!string(Elem.sizeof));
~ size.stringof);
// partition
while (r.length > shortSortGetsBetter)