summaryrefslogtreecommitdiff
path: root/vendor/github.com/puzpuzpuz/xsync/v3/mapof.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-03-03 10:42:05 +0000
committerLibravatar GitHub <noreply@github.com>2025-03-03 10:42:05 +0000
commit67a2b3650c5f586431c8559bc9b609699de8431d (patch)
treef4a269939f7f175277a92aaa33bf58e652d4e276 /vendor/github.com/puzpuzpuz/xsync/v3/mapof.go
parent[chore]: Bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 (#3860) (diff)
downloadgotosocial-67a2b3650c5f586431c8559bc9b609699de8431d.tar.xz
bumps our uptrace/bun dependencies to v1.2.10 (#3865)
Diffstat (limited to 'vendor/github.com/puzpuzpuz/xsync/v3/mapof.go')
-rw-r--r--vendor/github.com/puzpuzpuz/xsync/v3/mapof.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/vendor/github.com/puzpuzpuz/xsync/v3/mapof.go b/vendor/github.com/puzpuzpuz/xsync/v3/mapof.go
index cbf9cac91..d1ce9b2e2 100644
--- a/vendor/github.com/puzpuzpuz/xsync/v3/mapof.go
+++ b/vendor/github.com/puzpuzpuz/xsync/v3/mapof.go
@@ -239,9 +239,9 @@ func (m *MapOf[K, V]) LoadAndStore(key K, value V) (actual V, loaded bool) {
}
// LoadOrCompute returns the existing value for the key if present.
-// Otherwise, it computes the value using the provided function and
-// returns the computed value. The loaded result is true if the value
-// was loaded, false if stored.
+// Otherwise, it computes the value using the provided function, and
+// then stores and returns the computed value. The loaded result is
+// true if the value was loaded, false if computed.
//
// This call locks a hash table bucket while the compute function
// is executed. It means that modifications on other entries in
@@ -260,9 +260,10 @@ func (m *MapOf[K, V]) LoadOrCompute(key K, valueFn func() V) (actual V, loaded b
// LoadOrTryCompute returns the existing value for the key if present.
// Otherwise, it tries to compute the value using the provided function
-// and, if success, returns the computed value. The loaded result is true
-// if the value was loaded, false if stored. If the compute attempt was
-// cancelled, a zero value of type V will be returned.
+// and, if successful, stores and returns the computed value. The loaded
+// result is true if the value was loaded, or false if computed (whether
+// successfully or not). If the compute attempt was cancelled (due to an
+// error, for example), a zero value of type V will be returned.
//
// This call locks a hash table bucket while the compute function
// is executed. It means that modifications on other entries in