| author | |
| committer | |
| log | ee09eb7f5461aa9e2374a6adbfbf130bfc0ebf21 |
| tree | c73e6d66aa04a59360aaa760f5fde067d1b75555 |
| parent | 9d94c2ccd0341961ffb18ec7eb40ef6099d71794 |
standard library passes all tests now1 files changed, 3 insertions(+), 0 deletions(-)
std/hash_map.zig+3| ... | ... | @@ -76,6 +76,9 @@ pub fn HashMap(inline K: type, inline V: type, inline hash: fn(key: K)->u32, |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | pub fn put(hm: &Self, key: K, value: V) -> %void { |
| 79 | if (hm.entries.len == 0) { | |
| 80 | %return hm.initCapacity(16); | |
| 81 | } | |
| 79 | 82 | hm.incrementModificationCount(); |
| 80 | 83 | |
| 81 | 84 | // if we get too full (60%), double the capacity |