freemail
freemail copied to clipboard
use Set.has instead of Array.indexOf
Array.indexOf is O(n), but Set.has is O(1) ..or something similar. At any rate there's at least a 20x difference in performance given the size of the list here.
I made a jsperf to demonstrate this using 1/5 of the free emails.
https://jsperf.com/array-indexof-versus-set-has/1