Hash lookup may be faster here: http://mtdowling.com/blog/2014/03/17/hash-lookups-over-array-search/