aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-08-02 09:12:25 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-08-02 09:12:25 -0300
commit3152bb06cc3f82d05674bea60c2668d824e3c7a6 (patch)
tree8e18ea433507429a9a08abc9daefa80bc3589e5a /activerecord/lib/active_record
parent0d6e7ca9e5d376e741b00cfd9caddb8d6b30b84c (diff)
downloadrails-3152bb06cc3f82d05674bea60c2668d824e3c7a6.tar.gz
rails-3152bb06cc3f82d05674bea60c2668d824e3c7a6.tar.bz2
rails-3152bb06cc3f82d05674bea60c2668d824e3c7a6.zip
Use map! to avoid an extra object creation
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/core.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 609905b2ea..2b1e997ef4 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -346,7 +346,7 @@ module ActiveRecord
# Returns a hash of the given methods with their names as keys and returned values as values.
def slice(*methods)
- Hash[methods.map { |method| [method, public_send(method)] }].with_indifferent_access
+ Hash[methods.map! { |method| [method, public_send(method)] }].with_indifferent_access
end
def set_transaction_state(state) # :nodoc: