MCPcopy Create free account
hub / github.com/cockroachdb/redact / Reset

Method Reset

internal/buffer/buffer.go:277–282  ·  view source on GitHub ↗

Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes. It also resets the output mode to UnsafeEscaped.

()

Source from the content-addressed store, hash-verified

275// but it retains the underlying storage for use by future writes.
276// It also resets the output mode to UnsafeEscaped.
277func (b *Buffer) Reset() {
278 b.buf = b.buf[:0]
279 b.validUntil = 0
280 b.mode = UnsafeEscaped
281 b.markerOpen = false
282}
283
284// tryGrowByReslice is a inlineable version of grow for the fast-case where the
285// internal buffer only needs to be resliced.

Callers 4

TestBufferUnsafeWritesFunction · 0.95
resetWithModeMethod · 0.95
freeMethod · 0.80
appendHashFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestBufferUnsafeWritesFunction · 0.76
resetWithModeMethod · 0.76