Improve performance by skipping loop as soon as first match is found.
Merge pull request #6 from danez/patch-3

Improve performance by skipping loop as soon as first match is found.