If you use a for statement you could do a break early when you have matching IMHO