diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-03 16:33:46 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-10-03 16:33:46 -0200 |
commit | 5836af8f8b0eb3c569c66792abf50a0485bb6f22 (patch) | |
tree | b84009455ac23f55862e5cbec3b73258c3ab84c1 /activesupport/lib/active_support | |
parent | 42fad8c82b3ba6f86c84f06645cc1e39a8a776dd (diff) | |
download | rails-5836af8f8b0eb3c569c66792abf50a0485bb6f22.tar.gz rails-5836af8f8b0eb3c569c66792abf50a0485bb6f22.tar.bz2 rails-5836af8f8b0eb3c569c66792abf50a0485bb6f22.zip |
PERF: more Hash + map changes
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb index 7a6a0be69d..af30bfc13a 100644 --- a/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb @@ -158,9 +158,9 @@ class Class # :nodoc: if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES) new_inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES else - new_inheritable_attributes = inheritable_attributes.inject({}) do |memo, (key, value)| - memo.update(key => value.duplicable? ? value.dup : value) - end + new_inheritable_attributes = Hash[inheritable_attributes.map do |(key, value)| + [key, value.duplicable? ? value.dup : value] + end] end child.instance_variable_set('@inheritable_attributes', new_inheritable_attributes) |