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

Method returnBuffer

pkg/sql/parser/scan.go:78–82  ·  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

76// returnBuffer returns the unused portion of buf to the scanner, to be used for
77// future allocBytes() or buffer() calls. The caller must not use buf again.
78func (s *scanner) returnBuffer(buf []byte) {
79 if len(buf) < cap(buf) {
80 s.bytesPrealloc = buf[len(buf):]
81 }
82}
83
84// finishString casts the given buffer to a string and returns the unused
85// 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