Regarding isSorted
Brad Anderson
eco at gnuk.net
Tue Feb 5 17:21:54 PST 2013
Have a GitHub account, bearophile? Just hit Edit at the top of
that link you gave, make the change, and click "Proposal File
Change" and it'll roll up a pull request. Should take less than a
minute. I use this for almost every minor pull requests I do. The
autotester takes care of the rest.
Looks like line 9221 is essentially the same code so you may want
to change that line too.
BA
On Tue, Feb 5, 2013 at 5:33 PM, bearophile <bearophileHUGS at lycos.com> wrote:
> 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<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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20130205/92ceb2bb/attachment.html>
More information about the Digitalmars-d-learn
mailing list