Merge pull request #6263 from leviongit:array/delete

fix: `Array#delete` mistakingly calling block even if not passed
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-05-10 12:11:53 +09:00
committed by GitHub
+1 -1
View File
@@ -193,7 +193,7 @@ class Array
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