treemap: fix a bug in the union implementation

This commit is contained in:
Daniel Micay 2013-03-10 20:44:18 -04:00
parent 2889a8a4e5
commit 9b1a9ec4ea

View File

@ -486,6 +486,9 @@ impl<T: TotalOrd> Set<T> for TreeSet<T> {
a = set_next(&mut x);
}
}
do b.while_some |b1| {
if f(b1) { set_next(&mut y) } else { None }
}
}
}
}
@ -1182,6 +1185,7 @@ mod test_set {
check_union([], [], []);
check_union([1, 2, 3], [2], [1, 2, 3]);
check_union([2], [1, 2, 3], [1, 2, 3]);
check_union([1, 3, 5, 9, 11, 16, 19, 24],
[-2, 1, 5, 9, 13, 19],
[-2, 1, 3, 5, 9, 11, 13, 16, 19, 24]);