mirror of
https://github.com/rust-lang/rust
synced 2024-11-02 11:53:40 +00:00
auto merge of #5569 : thestinger/rust/map, r=catamorphism
This commit is contained in:
commit
30b1957cd4
1 changed files with 3 additions and 3 deletions
|
@ -49,19 +49,19 @@ fn descending<M: Map<uint, uint>>(map: &mut M, n_keys: uint) {
|
|||
io::println(" Descending integers:");
|
||||
|
||||
do timed("insert") {
|
||||
for uint::range(0, n_keys) |i| {
|
||||
for uint::range_rev(n_keys, 0) |i| {
|
||||
map.insert(i, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
do timed("search") {
|
||||
for uint::range(0, n_keys) |i| {
|
||||
for uint::range_rev(n_keys, 0) |i| {
|
||||
fail_unless!(map.find(&i).unwrap() == &(i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
do timed("remove") {
|
||||
for uint::range(0, n_keys) |i| {
|
||||
for uint::range_rev(n_keys, 0) |i| {
|
||||
fail_unless!(map.remove(&i));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue