More efficient Array#uniq! implementation