summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-structr/map.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/codeberg.org/gruf/go-structr/map.go')
-rw-r--r--vendor/codeberg.org/gruf/go-structr/map.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/codeberg.org/gruf/go-structr/map.go b/vendor/codeberg.org/gruf/go-structr/map.go
index 316a8e528..6a718eae1 100644
--- a/vendor/codeberg.org/gruf/go-structr/map.go
+++ b/vendor/codeberg.org/gruf/go-structr/map.go
@@ -5,7 +5,7 @@ type hashmap struct {
n int
}
-func (m *hashmap) init(cap int) {
+func (m *hashmap) Init(cap int) {
m.m = make(map[string]*list, cap)
m.n = cap
}
@@ -43,6 +43,10 @@ func (m *hashmap) Compact() {
// So we apply the inverse/2, once
// $maxLoad/2 % of hmap is empty we
// compact the map to drop buckets.
+ //
+ // TODO: this is still a relatively
+ // good approximation, but it has
+ // changed a little with swiss maps.
if 2*16*diff > m.n*13 {
// Create new map only big as required.