fastruby / fastruby/fast-ruby

Method call in a block could compare to `&:method_name` too

オープン
#201 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Suggestion
主要言語
Ruby
スター
5.7k
フォーク
371
PR マージ指標
30日以内にマージされた PR はありません

説明

This test https://github.com/fastruby/fast-ruby/blob/master/code/general/block-apply-method.rb is comparing:

```rb
def fast
[1, 2, 3].map { |n| do_something(n) }
end

def slow
[1, 2, 3].map(&method(:do_something))
end
```

We could have one more test:

```
def other
[1, 2, 3].map(&:do_something)
end
```

Also, I think the names `fast` and `slow` shouldn't be used for the methods, the names should describe what the method does, not which one is faster?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。