diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index 4adfaecd4aeed0033c7cbaefcc7c911b1fa9e7e2..491cfdcf773c2648b2104e3490dc05b850fd74ed 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -64,9 +64,8 @@ def self.[](*args) raise ArgumentError.new("odd number of arguments for Hash") end - args.each_with_index do |val, ind| - next if (ind % 2 != 0) - ordered_hash[val] = args[ind + 1] + 0.step(args.length, 2) do |ind| + ordered_hash[args[ind]] = args[ind + 1] end ordered_hash