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

Method TakeRedactableBytes

internal/buffer/buffer.go:90–97  ·  view source on GitHub ↗

TakeRedactableBytes returns the buffer contents and reinitializes the buffer. This saves a memory allocation compared to RedactableBytes().

()

Source from the content-addressed store, hash-verified

88// contents and reinitializes the buffer. This saves
89// a memory allocation compared to RedactableBytes().
90func (b *Buffer) TakeRedactableBytes() m.RedactableBytes {
91 b.finalize()
92 r := b.buf
93 b.buf = nil
94 b.validUntil = 0
95 b.mode = UnsafeEscaped
96 return m.RedactableBytes(r)
97}
98
99// TakeRedactableString returns the buffer
100// contents and reinitializes the buffer. This saves

Callers 3

FprintfFunction · 0.80
FprintFunction · 0.80
FprintlnFunction · 0.80

Calls 2

finalizeMethod · 0.95
RedactableBytesMethod · 0.80

Tested by

no test coverage detected