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)
}
// zlibState holds the persistent zlib writer, output buffer, and a scratch
// slice reused by encodeZlibRect to stage the packed pixel stream before
// handing it to the deflate writer. The scratch grows to the largest rect
// we've seen and is kept for the session lifetime.
// zlibState holds the persistent zlib writer and its output buffer, reused
// across rects so steady-state Tight encoding stays alloc-free.
type zlibState struct {
buf *bytes.Buffer
w *zlib.Writer
scratch []byte
buf *bytes.Buffer
w *zlib.Writer
}
func newZlibState() *zlibState {