On Wednesday, 22 October 2014 at 07:38:01 UTC, bearophile wrote:
neal:
data.sort!q{ to!int(a[4]) > to!int(b[4]) };
This code fixes my problem! Thanks for the quick responses
guys. you rock!
That converts string->int many more than once for each string.
So if memory is not a problem, consider using a
decorate-sort-undecorate pattern:
data.schwartzSort!q{ a[4].to!int };
Bye,
bearophile
Interesting! Thank you. Memory isn't a problem but I would still
like to learn how to write more efficient programs. If i posted
my code would you be able to give me some advice?