From f3f34bce8fc2895e05c4a06bb4105d6155fa423d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 13 Oct 2010 20:51:51 -0700 Subject: refactor delete a little --- activesupport/lib/active_support/ordered_hash.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index 7f148dc853..4adfaecd4a 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -84,10 +84,7 @@ module ActiveSupport 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 -- cgit v1.2.3