Permalink
Browse files

avoid intermediate zipped array

  • Loading branch information...
1 parent 6cd8e3f commit 1f75319a9af595d5de3dca55e26547c7f1b166fa @tenderlove tenderlove committed Jul 2, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 activerecord/lib/active_record/relation/calculations.rb
@@ -161,9 +161,8 @@ def pluck(*column_names)
result = result.map do |attributes|
values = klass.initialize_attributes(attributes).values
- columns.zip(values).map do |column, value|
- column.type_cast(value)
- end
+ iter = columns.each
+ values.map { |value| iter.next.type_cast value }
end
columns.one? ? result.map!(&:first) : result
end

0 comments on commit 1f75319

Please sign in to comment.