3 ms·
In situations where it's unlikely calling a method will result in a NoMethodError, i prefer rescuing the exception over checking if the method exists first. Thi
by waxjar 11y ago
In situations where it's unlikely calling a method will result in a NoMethodError, i prefer rescuing the exception over checking if the method exists first. This will be faster when it does not result in a NoMethodError.
In the "Enumerable#select.last vs Enumerable#reverse.detect" benchmark it would be interesting to know what the result of Enumerable#reverse_each.detect would be.