parent
82fe19769a
commit
f728614ef8
1 changed files with 17 additions and 0 deletions
|
|
@ -387,6 +387,7 @@ proc assign*(dest: var IntSet, src: IntSet) =
|
||||||
else:
|
else:
|
||||||
dest.counter = src.counter
|
dest.counter = src.counter
|
||||||
dest.max = src.max
|
dest.max = src.max
|
||||||
|
dest.elems = src.elems
|
||||||
newSeq(dest.data, src.data.len)
|
newSeq(dest.data, src.data.len)
|
||||||
|
|
||||||
var it = src.head
|
var it = src.head
|
||||||
|
|
@ -653,3 +654,19 @@ when isMainModule:
|
||||||
xs = toSeq(items(x))
|
xs = toSeq(items(x))
|
||||||
xs.sort(cmp[int])
|
xs.sort(cmp[int])
|
||||||
assert xs == @[1, 4, 7, 1001, 1056]
|
assert xs == @[1, 4, 7, 1001, 1056]
|
||||||
|
|
||||||
|
proc bug12366 =
|
||||||
|
var
|
||||||
|
x = initIntSet()
|
||||||
|
y = initIntSet()
|
||||||
|
n = 3584
|
||||||
|
|
||||||
|
for i in 0..n:
|
||||||
|
x.incl(i)
|
||||||
|
y.incl(i)
|
||||||
|
|
||||||
|
let z = symmetricDifference(x, y)
|
||||||
|
doAssert z.len == 0
|
||||||
|
doAssert $z == "{}"
|
||||||
|
|
||||||
|
bug12366()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue