Remove redundant conditions of Array#each in ruby extension

This commit is contained in:
Yusuke Tanaka
2015-12-15 19:47:18 +09:00
parent 2a234a93d7
commit d3f59db597
+2 -4
View File
@@ -15,10 +15,8 @@ class Array
idx, length = -1, self.length-1
while idx < length and length <= self.length and length = self.length-1
elm = self[idx += 1]
unless elm
if elm.nil? and length >= self.length
break
end
if elm.nil? and length >= self.length
break
end
block.call(elm)
end