提交 9c53e82d 编写于 作者: A Aaron Patterson

speeding up flattened version of OrderedHash.[]

上级 f3f34bce
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册