summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-structr/map.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-03-12 20:33:35 +0000
committerLibravatar GitHub <noreply@github.com>2025-03-12 20:33:35 +0000
commitf30bb549aae20281e169d0e7eaf7d70730955f02 (patch)
treebfef2396b10ca2af4a96bcbc097f05a191be6bbb /vendor/codeberg.org/gruf/go-structr/map.go
parent[docs] Update swagger docs command (#3897) (diff)
downloadgotosocial-f30bb549aae20281e169d0e7eaf7d70730955f02.tar.xz
update go-structr to v0.9.0 with new Timeline{} cache type (#3903)
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.