Call `uniq!` for each union processing in `Array#union`.

parent 249fef7d
......@@ -143,11 +143,11 @@ class Array
#
def union(*args)
ary = self.dup
args.each_with_index do |x,i|
args.each do |x|
ary.concat(x)
ary.uniq! if i % 20 == 0
ary.uniq!
end
ary.uniq! or ary
ary
end
##
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment