mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Implement std::map as an iface/impl instead of an obj
This commit is contained in:
@@ -78,7 +78,7 @@ fn uint_id(&&x: uint) -> uint { x }
|
||||
|
||||
|
||||
/**
|
||||
* Force map growth and rehashing.
|
||||
* Force map growth
|
||||
*/
|
||||
#[test]
|
||||
fn test_growth() {
|
||||
@@ -107,7 +107,6 @@ fn uint_id(&&x: uint) -> uint { x }
|
||||
assert (hm_uu.insert(num_to_insert, 17u));
|
||||
assert (hm_uu.get(num_to_insert) == 17u);
|
||||
#debug("-----");
|
||||
hm_uu.rehash();
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
#debug("get(%u) = %u", i, hm_uu.get(i));
|
||||
@@ -142,7 +141,6 @@ fn uint_id(&&x: uint) -> uint { x }
|
||||
assert (str::eq(hm_ss.get(uint::to_str(num_to_insert, 2u)),
|
||||
uint::to_str(17u, 2u)));
|
||||
#debug("-----");
|
||||
hm_ss.rehash();
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
#debug("get(\"%s\") = \"%s\"",
|
||||
@@ -200,9 +198,6 @@ fn hash(&&u: uint) -> uint {
|
||||
i += 2u;
|
||||
}
|
||||
#debug("-----");
|
||||
#debug("rehashing");
|
||||
hm.rehash();
|
||||
#debug("-----");
|
||||
i = 1u;
|
||||
while i < num_to_insert {
|
||||
#debug("get(%u) = %u", i, hm.get(i));
|
||||
@@ -225,9 +220,6 @@ fn hash(&&u: uint) -> uint {
|
||||
i += 1u;
|
||||
}
|
||||
#debug("-----");
|
||||
#debug("rehashing");
|
||||
hm.rehash();
|
||||
#debug("-----");
|
||||
assert (hm.size() == num_to_insert);
|
||||
i = 0u;
|
||||
while i < num_to_insert {
|
||||
|
||||
Reference in New Issue
Block a user