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:
parent
245ee50e6b
commit
0bf222677f
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue