avoid toLower in std.algorithm.sort compare alias

Jay Norwood jayn at prismnet.com
Mon Apr 23 06:49:50 PDT 2012


On Monday, 23 April 2012 at 11:27:40 UTC, Steven Schveighoffer
wrote:

> I think using std.string.icmp is the best solution.  I would 
> expect it to outperform even schwartz sort.
>
> -Steve

icmp took longer... added about 1 sec vs  0.3 sec (for
schwartzSort ) to the program execution time.

bool myComp(string x, string y) { return std.string.icmp(x,y)<0; }
std.algorithm.sort!(myComp)(dirs);

finished! time:1396 ms






More information about the Digitalmars-d-learn mailing list