Fixed a bug in `Array#difference`.
MODIFY
mrbgems/mruby-array-ext/mrblib/array.rb
mrbgems/mruby-array-ext/mrblib/array.rb
@@ -133,9 +133,9 @@ class Array
# preserved from the original array.
#
def difference(*args)
- ary = self.dup
+ ary = self
args.each do |x|
- ary = self - x
+ ary = ary - x
end
ary
end

MODIFY
mrbgems/mruby-array-ext/test/array.rb
mrbgems/mruby-array-ext/test/array.rb
@@ -94,9 +94,9 @@ assert("Array#union") do
end
assert("Array#difference") do
- a = [1, 2, 3, 1]
- b = [1, 4]
- c = [1, 5]
+ a = [1, 2, 3, 1, 6, 7]
+ b = [1, 4, 6]
+ c = [1, 5, 7]
assert_equal [2, 3], a.difference(b,c)
end

Fixed a bug in `Array#difference`.