Thread overview
[Issue 9457] New: isSorted(string) doesn't work
Feb 12, 2013
Andrej Mitrovic
February 06, 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@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@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: -------
February 06, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9457



--- Comment #1 from bearophile_hugs@eml.cc 2013-02-05 18:10:44 PST ---
A comment from Brad Anderson:

> Looks like line 9221 is essentially the same code so you may want to change that line too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9457


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression


--- Comment #2 from bearophile_hugs@eml.cc 2013-02-06 03:10:17 PST ---
This used to work not too much time ago.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9457


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com
         AssignedTo|nobody@puremagic.com        |andrej.mitrovich@gmail.com


--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-12 13:52:58 PST ---
https://github.com/D-Programming-Language/phobos/pull/1136

Thanks for your fix Bearophile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9457



--- Comment #4 from github-bugzilla@puremagic.com 2013-02-12 14:43:43 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/98cb833137c1c7cb9a51e7acb3cdf43332e0c7ac Fixes Issue 9457 - isSorted(string) does not work.

https://github.com/D-Programming-Language/phobos/commit/8bf6997acfdbe81442e4c3e4c3500b9197ffaaca Merge pull request #1136 from AndrejMitrovic/Fix9457

Issue 9457 - isSorted(string) does not work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9457


Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrei@erdani.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 13, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9457



--- Comment #5 from github-bugzilla@puremagic.com 2013-02-13 00:13:52 PST ---
Commit pushed to staging at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/e652b208dce5b36ab4c4d6b38fc537edf7013148 Fixes Issue 9457 - isSorted(string) does not work.

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