small refactoring for Array#each

parent 1184efe6
...@@ -11,8 +11,9 @@ class Array ...@@ -11,8 +11,9 @@ class Array
# ISO 15.2.12.5.10 # ISO 15.2.12.5.10
def each(&block) def each(&block)
idx, length = -1, self.length-1 idx, length = -1, self.length-1
block.call(self[idx += 1]) while(idx < length) while(idx < length)
block.call(self[idx += 1])
end
self self
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment