From: Robert Klemme Date: 2011-11-12T08:21:16+09:00 Subject: Re: The fastest way to read files On Sat, Nov 12, 2011 at 12:20 AM, Robert Klemme wrote: > On Fri, Nov 11, 2011 at 10:07 PM, Ryan Davis wrote: >> >> On Nov 11, 2011, at 04:50 , Robert Klemme wrote: >> >>> # ensure every word is only once in memory >>> words = Hash.new {|h,k| k.freeze; h[k] = k} >> >> AFAIK, Ruby hashes have (almost) always frozen their keys. > > I know.  That's the reason why I do the freeze in the block. PS: It's true for String keys only. -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/