mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make Enumerable.pluck
faster for single key
This commit is contained in:
parent
ab0e39c231
commit
80f59eadb4
1 changed files with 2 additions and 1 deletions
|
@ -153,7 +153,8 @@ module Enumerable
|
|||
if keys.many?
|
||||
map { |element| keys.map { |key| element[key] } }
|
||||
else
|
||||
map { |element| element[keys.first] }
|
||||
key = keys.first
|
||||
map { |element| element[key] }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue