Skip to content

Commit 53aa5e7

Browse files
committed
Apply @ixti's reviews
Closes #87
1 parent fb190b5 commit 53aa5e7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ Comparison:
735735

736736
##### `Proc#call` and block arguments vs `yield`[code](code/proc-and-block/proc-call-vs-yield.rb)
737737

738-
[In MRI Ruby, block arguments are converted to Procs, which incurs a heap allocation](https://www.omniref.com/ruby/2.2.0/symbols/Proc/yield?#annotation=4087638&line=711).
738+
In MRI Ruby, block arguments [are converted to Procs](https://www.omniref.com/ruby/2.2.0/symbols/Proc/yield?#annotation=4087638&line=711), which incurs a heap allocation.
739739

740740
```
741741
$ ruby -v code/proc-and-block/proc-call-vs-yield.rb

code/proc-and-block/proc-call-vs-yield.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
require 'benchmark/ips'
22

3-
def slow &block
3+
def slow(&block)
44
block.call
55
end
66

7-
def slow2 &block
7+
def slow2(&block)
88
yield
99
end
1010

11-
def slow3 &block
11+
def slow3(&block)
1212

1313
end
1414

0 commit comments

Comments
 (0)