summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-fastpath
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-11-10 12:36:59 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:13:24 +0100
commitac877bde815827f7aa1eeb3a6f0513d4c7503ad0 (patch)
tree7a315d820a5be3232dd5bfc96857017c38e906fd /vendor/codeberg.org/gruf/go-fastpath
parent[chore] update dependencies (#4542) (diff)
downloadgotosocial-ac877bde815827f7aa1eeb3a6f0513d4c7503ad0.tar.xz
[performance] add optional S3 object info caching (#4546)
This adds an optional S3 object info cache to the S3 storage driver backend (see [here](https://codeberg.org/gruf/go-storage/releases/tag/v0.4.0)) to reduce S3 calls largely during media cleanup operations, but it should also help in other situations cutting back on S3 calls when for example a key is already known to not exist. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4546 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-fastpath')
-rw-r--r--vendor/codeberg.org/gruf/go-fastpath/v2/path.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/codeberg.org/gruf/go-fastpath/v2/path.go b/vendor/codeberg.org/gruf/go-fastpath/v2/path.go
index 42cbfd4f7..91ebb5b36 100644
--- a/vendor/codeberg.org/gruf/go-fastpath/v2/path.go
+++ b/vendor/codeberg.org/gruf/go-fastpath/v2/path.go
@@ -33,12 +33,14 @@ func (b *Builder) Reset() {
b.set = false
}
-// Len returns the number of accumulated bytes in the Builder
+// Len returns the number of
+// accumulated bytes in the Builder.
func (b Builder) Len() int {
return len(b.B)
}
-// Cap returns the capacity of the underlying Builder buffer
+// Cap returns the capacity of
+// the underlying Builder buffer.
func (b Builder) Cap() int {
return cap(b.B)
}
@@ -50,7 +52,7 @@ func (b Builder) Bytes() []byte {
// String returns the accumulated path string.
func (b Builder) String() string {
- return *(*string)(unsafe.Pointer(&b.B))
+ return unsafe.String(unsafe.SliceData(b.B), len(b.B))
}
// Absolute returns whether current path is absolute (not relative).
@@ -139,7 +141,7 @@ func (b *Builder) AppendBytes(path []byte) {
return
}
b.Guarantee(len(path) + 1)
- b.append(*(*string)(unsafe.Pointer(&b)))
+ b.append(unsafe.String(unsafe.SliceData(path), len(path)))
}
// Append adds and cleans the supplied path string to the