Skip to content

Commit a8763f3

Browse files
committed
Don't create HashMap<K, V> when not needed
1 parent 48b22b8 commit a8763f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/run-pass/hashmap.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ fn test_map<S: BuildHasher>(mut map: HashMap<i32, i32, S>) {
2727
}
2828

2929
fn main() {
30-
let _map : HashMap<i32, i32, BuildHasherDefault<collections::hash_map::DefaultHasher>> = Default::default();
31-
3230
// TODO: Implement random number generation on OS X
3331
if cfg!(not(target_os = "macos")) {
3432
let map_normal: HashMap<i32, i32> = HashMap::new();
3533
test_map(map_normal);
3634
} else {
37-
test_map(_map);
35+
let map : HashMap<i32, i32, BuildHasherDefault<collections::hash_map::DefaultHasher>> = Default::default();
36+
test_map(map);
3837
}
3938
}

0 commit comments

Comments
 (0)