diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-03-10 20:44:18 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-03-11 22:36:23 -0400 |
| commit | 9b1a9ec4ea87d3ff25ecf361c78c6119590d62a9 (patch) | |
| tree | 5916091c628047aed3e91bf5a2cb0bf9436e94af /src/libstd | |
| parent | 2889a8a4e5a490cf650d3730bc05a1694a1d3310 (diff) | |
| download | rust-9b1a9ec4ea87d3ff25ecf361c78c6119590d62a9.tar.gz rust-9b1a9ec4ea87d3ff25ecf361c78c6119590d62a9.zip | |
treemap: fix a bug in the union implementation
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/treemap.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/treemap.rs b/src/libstd/treemap.rs index 28ed95a0978..42a84da43d2 100644 --- a/src/libstd/treemap.rs +++ b/src/libstd/treemap.rs @@ -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]); |
