mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Use SIMD base64 encoding for graphics transmission
This commit is contained in:
@@ -5,12 +5,13 @@ package graphics
|
||||
import (
|
||||
"bytes"
|
||||
"compress/zlib"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/emmansun/base64"
|
||||
|
||||
"github.com/kovidgoyal/kitty/tools/tty"
|
||||
"github.com/kovidgoyal/kitty/tools/tui/loop"
|
||||
"github.com/kovidgoyal/kitty/tools/utils"
|
||||
|
||||
@@ -19,10 +19,7 @@ func collectDecode(t *testing.T, d *StreamingBase64Decoder, encoded []byte, chun
|
||||
t.Helper()
|
||||
var result []byte
|
||||
for len(encoded) > 0 {
|
||||
end := chunkSize
|
||||
if end > len(encoded) {
|
||||
end = len(encoded)
|
||||
}
|
||||
end := min(chunkSize, len(encoded))
|
||||
chunk := encoded[:end]
|
||||
encoded = encoded[end:]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user