MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / returnBuffer

Method returnBuffer

pkg/sql/scanner/scan.go:130–134  ·  view source on GitHub ↗

returnBuffer returns the unused portion of buf to the Scanner, to be used for future allocBytes() or buffer() calls. The caller must not use buf again.

(buf []byte)

Source from the content-addressed store, hash-verified

128// returnBuffer returns the unused portion of buf to the Scanner, to be used for
129// future allocBytes() or buffer() calls. The caller must not use buf again.
130func (s *Scanner) returnBuffer(buf []byte) {
131 if len(buf) < cap(buf) {
132 s.bytesPrealloc = buf[len(buf):]
133 }
134}
135
136// finishString casts the given buffer to a string and returns the unused
137// portion of the buffer. The caller must not use buf again.

Callers 1

finishStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected