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

Method Close

pkg/sql/sem/tree/format.go:839–845  ·  view source on GitHub ↗

Close releases a FmtCtx for reuse. Closing a FmtCtx is not required, but is recommended for performance-sensitive paths.

()

Source from the content-addressed store, hash-verified

837// Close releases a FmtCtx for reuse. Closing a FmtCtx is not required, but is
838// recommended for performance-sensitive paths.
839func (ctx *FmtCtx) Close() {
840 ctx.Buffer.Reset()
841 *ctx = FmtCtx{
842 Buffer: ctx.Buffer,
843 }
844 fmtCtxPool.Put(ctx)
845}
846
847// CloseAndGetString combines Close() and String().
848func (ctx *FmtCtx) CloseAndGetString() string {

Callers 5

CloseAndGetStringMethod · 0.95
initFunction · 0.95
writeFileFunction · 0.45
EncodeFunction · 0.45
EncodeFunction · 0.45

Calls 1

ResetMethod · 0.65

Tested by

no test coverage detected