Neat Way Of Removing Duplicates From Array

Depending on how large your array is and how many duplicate elements it has, you could sort it and use a haxe.ds.Vector to allocate unique elements while keeping track of the last added element: Try Haxe !.

This might work better for a large array with a smaller range of elements. Not sure what effect it would have for dynamic targets that don’t support fixed-sized arrays though.

1 Like