Skip to content

Commit

Permalink
Merge pull request #6263 from leviongit:array/delete
Browse files Browse the repository at this point in the history
fix: `Array#delete` mistakingly calling block even if not passed
  • Loading branch information
matz committed May 10, 2024
2 parents 19d9f48 + 67df0ac commit 058a4ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mrblib/array.rb
Expand Up @@ -193,7 +193,7 @@ def <=>(other)
def delete(key, &block)
len = self.length
ret = self.__delete(key)
return block.call() if len == self.length
return block&.call() if len == self.length

ret
end
Expand Down

0 comments on commit 058a4ab

Please sign in to comment.