[Issue 9457] New: isSorted(string) doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 5 17:08:15 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9457

           Summary: isSorted(string) doesn't work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-02-05 17:08:14 PST ---
This used to print true-false, but in DMD 2.062alpha prints true-true on
Windows:


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)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list