提交 6617437e 编写于 作者: J José Valim

Merge pull request #12091 from rywall/pluck-optimization

[Perf] Don't use Enumerable#next in pluck since it is very slow
......@@ -161,8 +161,7 @@ def pluck(*column_names)
result = result.map do |attributes|
values = klass.initialize_attributes(attributes).values
iter = columns.each
values.map { |value| iter.next.type_cast value }
columns.zip(values).map { |column, value| column.type_cast value }
end
columns.one? ? result.map!(&:first) : result
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册