summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/s2/encode_go.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-03-02 16:42:51 +0100
committerLibravatar GitHub <noreply@github.com>2025-03-02 16:42:51 +0100
commit8488ac928651656c6f7bebf5eaabce62c2b9fb66 (patch)
tree94357311026e5ed96862a647400375a4543dd815 /vendor/github.com/klauspost/compress/s2/encode_go.go
parent[chore] go-swagger -> codeberg (#3856) (diff)
downloadgotosocial-8488ac928651656c6f7bebf5eaabce62c2b9fb66.tar.xz
[chore] migrate oauth2 -> codeberg (#3857)
Diffstat (limited to 'vendor/github.com/klauspost/compress/s2/encode_go.go')
-rw-r--r--vendor/github.com/klauspost/compress/s2/encode_go.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/s2/encode_go.go b/vendor/github.com/klauspost/compress/s2/encode_go.go
index dd1c973ca..e25b78445 100644
--- a/vendor/github.com/klauspost/compress/s2/encode_go.go
+++ b/vendor/github.com/klauspost/compress/s2/encode_go.go
@@ -21,6 +21,9 @@ func encodeBlock(dst, src []byte) (d int) {
if len(src) < minNonLiteralBlockSize {
return 0
}
+ if len(src) <= 64<<10 {
+ return encodeBlockGo64K(dst, src)
+ }
return encodeBlockGo(dst, src)
}
@@ -32,6 +35,9 @@ func encodeBlock(dst, src []byte) (d int) {
//
// len(dst) >= MaxEncodedLen(len(src))
func encodeBlockBetter(dst, src []byte) (d int) {
+ if len(src) <= 64<<10 {
+ return encodeBlockBetterGo64K(dst, src)
+ }
return encodeBlockBetterGo(dst, src)
}
@@ -43,6 +49,9 @@ func encodeBlockBetter(dst, src []byte) (d int) {
//
// len(dst) >= MaxEncodedLen(len(src))
func encodeBlockBetterSnappy(dst, src []byte) (d int) {
+ if len(src) <= 64<<10 {
+ return encodeBlockBetterSnappyGo64K(dst, src)
+ }
return encodeBlockBetterSnappyGo(dst, src)
}
@@ -57,6 +66,9 @@ func encodeBlockSnappy(dst, src []byte) (d int) {
if len(src) < minNonLiteralBlockSize {
return 0
}
+ if len(src) <= 64<<10 {
+ return encodeBlockSnappyGo64K(dst, src)
+ }
return encodeBlockSnappyGo(dst, src)
}