Use Enumerable#detect instead of select+first combo.

Use Enumerable#detect ( http://ruby-doc.org/core-2.1.5/Enumerable.html#method-i-detect ) instead of select+first combo. 
It's faster since it stop iterating on first match.