On Tue, Jan 29, 2013 at 10:25 AM, Ryan Davis <ryand-ruby / zenspider.com> wro=
te:
>
> On Jan 28, 2013, at 12:13 , Jes=FAs Gabriel y Gal=E1n <jgabrielygalan@gma=
il.com> wrote:
>
>> On Mon, Jan 28, 2013 at 7:16 PM, Joel Pearson <lists / ruby-forum.com> wro=
te:
>>> "Jes=FAs Gabriel y Gal=E1n" <jgabrielygalan / gmail.com> wrote in post
>>> #1094106:
>>>> string.downcase.scan(/\w+/) {|word| res[word] +=3D 1}
>>>
>>> I tried benchmarking out of curiosity and that is a lot faster! Nicely
>>> done.
>>
>> I guess the reason is that you avoid the intermediate arrays.
>
> I suspect only scanning once is much more important than the extra arrays=
.

Sure, you are right. I didn't really read Joel's proposal, and assume
he had removed the double scan.

Jesus.