From: Joel VanderWerf Date: 2007-10-08T06:34:41+09:00 Subject: Re: #sort_by and #sort_obj Rick DeNatale wrote: > On 10/7/07, Joel VanderWerf wrote: >> Eric Hodel wrote: >>> somethings.sort_by { |s| s.sort_obj } >> Since this is more efficient than #sort, maybe the implementation of >> #sort should first try to do this, and only if that fails (#sort_obj not >> defined, or two sort_obj not comparable), revert to the normal <=> >> algorithm. > > Yes, but sort_by is not always more efficient than sort: Quite right, #sort should stay as it is, and #sort_by should only be called explicitly. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407