From: James Gray Date: 2008-12-01T01:29:44+09:00 Subject: Re: Enumerable#select used to return actual values On Nov 30, 2008, at 4:26 AM, Robert Dober wrote: > On Sun, Nov 30, 2008 at 11:13 AM, David A. Black > wrote: > >> There's also: >> >> res = [] >> (1..10).each {|e| res << (e * e) if e > 5 } >> res >> >> No shame in a local variable now and then :-) > Not at all, and it is often the *fastest* solution as, unfortunately, > #inject is slow. My opinion is that if inject() is really the biggest time sync in your code, you're in big trouble. ;) James Edward Gray II