diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-25 23:14:38 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-25 23:14:38 +0900 |
| commit | 71f9add1c5a655d6265147be0546d9770ed0f629 (patch) | |
| tree | 48afcccf67afb4ea8243571dd1a5b36654acfb14 /mrblib | |
| parent | fba7874a680ef686ae1d3915dbadbe7a3a26b8b7 (diff) | |
| download | mruby-71f9add1c5a655d6265147be0546d9770ed0f629.tar.gz mruby-71f9add1c5a655d6265147be0546d9770ed0f629.zip | |
Move inline `iseq` in `array.c` to `array.rb`.
There's no efficiency difference since `cdump` is implemented.
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/array.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mrblib/array.rb b/mrblib/array.rb index e248914e8..6708027ab 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 - # - # idx = 0 - # while idx < length - # block.call(self[idx]) - # idx += 1 - # end - # self - # end + def each(&block) + return to_enum :each unless block + + idx = 0 + while idx < length + block.call(self[idx]) + idx += 1 + end + self + end ## # Calls the given block for each element of +self+ |
