aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/ordered_hash.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb
index dfc3f01fa2..4adfaecd4a 100644
--- a/activesupport/lib/active_support/ordered_hash.rb
+++ b/activesupport/lib/active_support/ordered_hash.rb
@@ -79,15 +79,12 @@ module ActiveSupport
end
def []=(key, value)
- @keys << key if !has_key?(key)
+ @keys << key unless has_key?(key)
super
end
def delete(key)
- if has_key? key
- index = @keys.index(key)
- @keys.delete_at index
- end
+ @keys.delete key if has_key? key
super
end