Permalink
Browse files

Fix Array#delete_if to check if empty. Closes #273.

  • Loading branch information...
1 parent fb962df commit 9098d4d767fabbcbfb25b4a08328631d30325227 Brian Ford committed May 3, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 kernel/common/array.rb
@@ -538,6 +538,8 @@ def delete_at(idx)
def delete_if(&block)
return to_enum :delete_if unless block_given?
+ return self if empty?
+
key = undefined
i = to_iter
while i.next

0 comments on commit 9098d4d

Please sign in to comment.