Use set instead of binary addition

We should use set here like 1.8.1 does. It is 2x faster than binary addition:
https://community.bistudio.com/wiki/Code_Optimisation#Adding_elements_to_an_array
Merge pull request #1438 from ebaydayz/patch-1

Use set instead of binary addition