diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2024-07-09 18:30:03 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2024-07-10 13:00:47 +0900 |
| commit | 182822683f86c8f8d63b05765addf5a04d112aa2 (patch) | |
| tree | 9277d1460fd5ff889c6d8ec2ca82b35e973051c2 /test | |
| parent | 114e32b35796ca546f429ee3295607a127d7e519 (diff) | |
Use rb_block_call2 for some Enumerable methods
Enumerable#all?, #any?, #one?, and #none? do not use yielded arguments
as an Array. So they can use rb_block_call2 to omit array allocatoin.
Enumerable#find does not have to immediately accept yielded arguments as
an Array. It can delay array allocation until the predicate block
returns truthy.
(TODO: Enumerable#count and #find_all seem to be optimizable as well.)
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
