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