From: Ryan Davis Date: 2013-01-29T18:25:21+09:00 Subject: Re: Please explain in English On Jan 28, 2013, at 12:13 , Jesús Gabriel y Galán wrote: > On Mon, Jan 28, 2013 at 7:16 PM, Joel Pearson wrote: >> "Jesús Gabriel y Galán" wrote in post >> #1094106: >>> string.downcase.scan(/\w+/) {|word| res[word] += 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.