MCPcopy
hub / github.com/coder/websocket / getFlateWriter

Function getFlateWriter

compress.go:152–160  ·  view source on GitHub ↗
(w io.Writer)

Source from the content-addressed store, hash-verified

150var flateWriterPool sync.Pool
151
152func getFlateWriter(w io.Writer) *flate.Writer {
153 fw, ok := flateWriterPool.Get().(*flate.Writer)
154 if !ok {
155 fw, _ = flate.NewWriter(w, flate.BestSpeed)
156 return fw
157 }
158 fw.Reset(w)
159 return fw
160}
161
162func putFlateWriter(w *flate.Writer) {
163 flateWriterPool.Put(w)

Callers 1

ensureFlateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…