MCPcopy
hub / github.com/danielgtaylor/huma / Reset

Method Reset

validate.go:159–162  ·  view source on GitHub ↗

Reset the path buffer to empty, keeping and reusing the underlying bytes.

()

Source from the content-addressed store, hash-verified

157
158// Reset the path buffer to empty, keeping and reusing the underlying bytes.
159func (b *PathBuffer) Reset() {
160 b.buf = b.buf[:0]
161 b.off = 0
162}
163
164// NewPathBuffer creates a new path buffer given an existing byte slice.
165// Tip: using `sync.Pool` can significantly reduce buffer allocations.

Callers 15

BenchmarkSchemaFunction · 0.95
BenchmarkSchemaErrorsFunction · 0.95
BenchmarkPathBufferFunction · 0.95
TestValidateFunction · 0.95
BenchmarkValidateFunction · 0.95
ValidateMethod · 0.45
TransformMethod · 0.45
EveryPBMethod · 0.45
RegisterFunction · 0.45

Calls

no outgoing calls

Tested by 15

BenchmarkSchemaFunction · 0.76
BenchmarkSchemaErrorsFunction · 0.76
BenchmarkPathBufferFunction · 0.76
TestValidateFunction · 0.76
BenchmarkValidateFunction · 0.76
BenchmarkRawBunRouterFunction · 0.36
BenchmarkHumaGorillaMuxFunction · 0.36