> But I also value you contribution, Adam and Jes=FBs. In fact, I think you=
r
> methods are faster than the inject's way.

You'd be surprised :-). If I didn't do anything wrong (I usually make
mistakes when benchmarking), my method is the slowest:

require 'benchmark'

TIMES =3D 100_000
array =3D [['a', 1], ['b', 2], ['a',2], ['c',4], ['d', 5], ['b',4]]

Benchmark.bm do |x|
	x.report "inject Jeremy" do
		TIMES.times do
			array.inject({}) do |result, (key, value)|
				(result[key] ||=3D []) << value
				result
			end
		end
	end

	x.report "Adam" do
		TIMES.times do
			result =3D {}
			array.each { |k, v| result[k] ||=3D []; result[k] << v }
		end
	end

	x.report "inject Andrew" do
		TIMES.times do
			hash =3D array.inject({}) do |result, values|
				key,val =3D values
				if result[key].nil?
					result[key] =3D [val]
				else
					result[key].push val
				end
				result
			end
		end
	end

	x.report "Jesus" do
		TIMES.times do
			result =3D Hash.new {|h,k| h[k] =3D []}
			array.each {|key,value| result[key] << value}
		end
	end
end

$ ruby bm_inject.rb
      user     system      total        real
inject Jeremy  1.440000   0.300000   1.740000 (  1.770496)
Adam  1.100000   0.190000   1.290000 (  1.290073)
inject Andrew  1.810000   0.210000   2.020000 (  2.064162)
Jesus  1.800000   0.320000   2.120000 (  2.118433)

I guess it's because you need to call the default proc many times, as
opposed to the other methods, which don't have any proc to call or
block to yield to.

Jesus.