Permalink
Browse files

Use map! to avoid an extra object creation

  • Loading branch information...
1 parent 0d6e7ca commit 3152bb06cc3f82d05674bea60c2668d824e3c7a6 @carlosantoniodasilva carlosantoniodasilva committed Aug 2, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/core.rb
@@ -346,7 +346,7 @@ def inspect
# 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:

0 comments on commit 3152bb0

Please sign in to comment.