Skip to content
Permalink
Browse files

Merge pull request #579 from kachick/fix-array-delete

Fix Array#delete
  • Loading branch information
alex committed Apr 9, 2013
2 parents 9992a67 + 4b3b3d5 commit 1f2d98d9b78292c3b8183dcc4d7089b68a9c2c7b
Showing with 8 additions and 3 deletions.
  1. +8 −2 lib-topaz/array.rb
  2. +0 −1 spec/tags/core/array/delete_tags.txt
@@ -142,8 +142,14 @@ def delete_if(&block)

def delete(obj, &block)
sz = self.size
self.delete_if { |o| o == obj }
return obj if sz != self.size
last_matched_element = nil
self.delete_if do |o|
if match = (o == obj)
last_matched_element = o
end
match
end
return last_matched_element if sz != self.size
return yield if block
return nil
end

This file was deleted.

0 comments on commit 1f2d98d

Please sign in to comment.
You can’t perform that action at this time.