This used to print true-false, now prints true-true. Is this a bug?

import std.stdio, std.algorithm;
void main() {
    auto x = "abcd";
    writeln(isSorted(x));
    auto y = "acbd";
    writeln(isSorted(y));
}


Maybe this line:

https://github.com/D-Programming-Language/phobos/blob/master/std/algorithm.d#L9237

        for (; !ahead.empty; ahead.popFront(), ++i)

Should be:

        for (; !ahead.empty; ahead.popFront(), r.popFront(), ++i)

Bye,
bearophile

Reply via email to