From: Robert Dober Date: 2008-11-28T01:47:43+09:00 Subject: Re: Performance issues with large files -- ruby vs. python : On Thu, Nov 27, 2008 at 4:57 PM, Charles Oliver Nutter wrote: > DO NOT use unless...else. It's the most confusing conditional construct > ever. Use if and flop the bodies, or just use if !condition. I have never heard you shout before, *unless* I am mistaken ;). I always felt that unless is just the human readable way of saying if not, but accountants do not have any taste (or something like that ;). Anyway here I would rather apply Ruby's on steroid (citing Dave Thomas) construct "case". case when not h.... .... when not h.... .... etc.etc else .... end I am not sure if faster code is generated but I would guess so. All that said I wonder if your code could not benefit of this kind of initialization @main_hash = Hash::new{ |h, k| h[k] = Hash::new{ |h, k| h[k] = {} I let *you* close all those accolades ;) HTH Robert -- Ne baisse jamais la tête, tu ne verrais plus les étoiles. Robert Dober ;)