diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-08-17 14:46:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-08-17 14:46:32 +0900 |
| commit | 5b1f25a4e0be7d1880f237b1c1bf5845af7b8588 (patch) | |
| tree | 83c8fe329455b892cd5c980d802d976a59160d55 /mrblib/array.rb | |
| parent | 13eaff4f9f20955441612fd605ae1932039ec03e (diff) | |
| download | mruby-5b1f25a4e0be7d1880f237b1c1bf5845af7b8588.tar.gz mruby-5b1f25a4e0be7d1880f237b1c1bf5845af7b8588.zip | |
Implement `Array#each` using inline mruby bytecode.
Diffstat (limited to 'mrblib/array.rb')
| -rw-r--r-- | mrblib/array.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mrblib/array.rb b/mrblib/array.rb index 2b080564c..6535d6d83 100644 --- a/mrblib/array.rb +++ b/mrblib/array.rb @@ -10,16 +10,16 @@ class Array # and pass the respective element. # # ISO 15.2.12.5.10 - def each(&block) - return to_enum :each unless block + # def each(&block) + # return to_enum :each unless block - idx = 0 - while idx < length - block.call(self[idx]) - idx += 1 - end - self - end + # idx = 0 + # while idx < length + # block.call(self[idx]) + # idx += 1 + # end + # self + # end ## # Calls the given block for each element of +self+ |
