Commit a734989
committed
Check only whether block was given
`rb_scan_args(argc, argv, "01&", ...)` will generate `Proc` object from
block.
However, the object has used to only check whether block was given.
To remove redundant object generating, this patch will use
`rb_block_given_p()` to check whether block was given.
* Before
```
Warming up --------------------------------------
query 845.000 i/100ms
each 86.916k i/100ms
fields 231.527k i/100ms
Calculating -------------------------------------
query 9.553k (± 2.0%) i/s - 48.320k in
5.059947s
each 1.133M (± 0.3%) i/s - 5.736M in
5.062606s
fields 6.319M (± 0.1%) i/s - 31.719M in
5.019960s
```
* After
```
Warming up --------------------------------------
query 864.000 i/100ms
each 106.916k i/100ms
fields 251.255k i/100ms
Calculating -------------------------------------
query 9.457k (± 3.8%) i/s - 47.520k in
5.032949s
each 1.550M (± 0.3%) i/s - 7.805M in
5.037029s
fields 6.233M (± 0.1%) i/s - 31.407M in
5.039049s
```1 parent d479969 commit a734989
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
| 744 | + | |
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
| 794 | + | |
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
| 812 | + | |
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| |||
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
825 | 828 | | |
826 | 829 | | |
827 | 830 | | |
| |||
887 | 890 | | |
888 | 891 | | |
889 | 892 | | |
890 | | - | |
| 893 | + | |
891 | 894 | | |
892 | 895 | | |
893 | 896 | | |
| |||
0 commit comments