Drop unused zlibState.scratch field

This commit is contained in:
Viktor Liu
2026-05-17 16:33:48 +02:00
parent da37a28951
commit b135d462d6

View File

@@ -602,14 +602,11 @@ func sampledColorCountInto(seen map[uint32]struct{}, img *image.RGBA, x, y, w, h
return len(seen) return len(seen)
} }
// zlibState holds the persistent zlib writer, output buffer, and a scratch // zlibState holds the persistent zlib writer and its output buffer, reused
// slice reused by encodeZlibRect to stage the packed pixel stream before // across rects so steady-state Tight encoding stays alloc-free.
// handing it to the deflate writer. The scratch grows to the largest rect
// we've seen and is kept for the session lifetime.
type zlibState struct { type zlibState struct {
buf *bytes.Buffer buf *bytes.Buffer
w *zlib.Writer w *zlib.Writer
scratch []byte
} }
func newZlibState() *zlibState { func newZlibState() *zlibState {