1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

No need to use inject

This commit is contained in:
Stefan Huber 2010-09-28 00:21:50 +01:00
parent 245ee50e6b
commit 0bf222677f

View file

@ -32,7 +32,7 @@ module Haml
# @param arr [Array<(Object, Object)>] An array of pairs
# @return [Hash] A hash
def to_hash(arr)
arr.compact.inject({}) {|h, (k, v)| h[k] = v; h}
Hash[arr.compact]
end
# Maps the keys in a hash according to a block.