From: Florian Frank Date: 2004-12-08T03:15:10+09:00 Subject: Re: Idiom for creating hash from two arrays Jonathan Paisley wrote: >I did some benchmark tests of all four implementations (my original, >your two, and the above). The last is about twice as fast as >each_with_index and inject, and at least an order of magnitude faster >than my original method involving flattening. > > Try this implementation, too: hash = {} keys.size.times { |i| hash[ keys[i] ] = values[i] } -- Florian Frank