aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-03-01 14:47:46 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-03-01 14:47:46 -0700
commit660a50661b22b279fed548387d19ffcddb031b23 (patch)
tree6fec568fa26d0343f39fcb1f576c3f6a4885456e /src
parent9c3d7b628c0b32d7276e4dc33e2e6f306af87472 (diff)
downloadzig-660a50661b22b279fed548387d19ffcddb031b23.tar.gz
zig-660a50661b22b279fed548387d19ffcddb031b23.zip
better hash table performance
Diffstat (limited to 'src')
-rw-r--r--src/hash_map.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hash_map.hpp b/src/hash_map.hpp
index 7f2d39ef86..9c9939e4cc 100644
--- a/src/hash_map.hpp
+++ b/src/hash_map.hpp
@@ -46,8 +46,8 @@ public:
_modification_count += 1;
internal_put(key, value);
- // if we get too full (80%), double the capacity
- if (_size * 5 >= _capacity * 4) {
+ // if we get too full (60%), double the capacity
+ if (_size * 5 >= _capacity * 3) {
Entry *old_entries = _entries;
int old_capacity = _capacity;
init_capacity(_capacity * 2);