Merging one Array with Another

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 2 03:18:06 PDT 2015


On Friday, 1 May 2015 at 19:30:08 UTC, Ilya Yaroshenko wrote:
> Both variants are wrong because uniq needs sorted ranges.
>
> Probably you need something like that:
>
> x = x.chain(y).sort.uniq.array;

Interesting.

Is

     x = x.chain(y).sort

faster than

     x ~= y;
     x.sort;

?

If so why?


More information about the Digitalmars-d-learn mailing list