From: Josh Cheek Date: 2011-07-01T20:58:39+09:00 Subject: Re: How to order Structs based on two fields --bcaec54ee9209df51304a700bc37 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Jul 1, 2011 at 6:30 AM, I=F1aki Baz Castillo wrote: > 2011/7/1 Gunther Diemant : > > Nice. Little mistake (same as mine). Code should be array.sort_by { |e| > > [e.a, -e.b] } > > Yeah :) > > So I've lot of solutions right now, and all of them work :) > > I'll do some benchmarks and select the fastest one. > > Really thanks to all, this community is really impresive. > > -- > I=F1aki Baz Castillo > > > I recommend selecting the most straightforward one. Are there any solutions where you look at them and they are so obvious as to seem mundane? Later when you look at this code, you'll be appreciative of code like that. --bcaec54ee9209df51304a700bc37--