MCPcopy
hub / github.com/tinylib/msgp / push

Method push

msgp/write.go:224–233  ·  view source on GitHub ↗

push one byte onto the buffer NOTE: this is a hot code path

(b byte)

Source from the content-addressed store, hash-verified

222//
223// NOTE: this is a hot code path
224func (mw *Writer) push(b byte) error {
225 if mw.wloc == len(mw.buf) {
226 if err := mw.flush(); err != nil {
227 return err
228 }
229 }
230 mw.buf[mw.wloc] = b
231 mw.wloc++
232 return nil
233}
234
235func (mw *Writer) prefix8(b byte, u uint8) error {
236 const need = 2

Callers 10

WriteMapHeaderMethod · 0.95
WriteArrayHeaderMethod · 0.95
WriteNilMethod · 0.95
WriteInt64Method · 0.95
WriteUint64Method · 0.95
WriteBoolMethod · 0.95
WriteStringMethod · 0.95
WriteStringHeaderMethod · 0.95
WriteStringFromBytesMethod · 0.95
WriteJSONNumberMethod · 0.95

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected