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

Function NewArrayBuilder

pkg/util/json/json.go:275–279  ·  view source on GitHub ↗

NewArrayBuilder returns an ArrayBuilder. The builder will reserve spaces based on hint about number of adds to reduce times of growing capacity.

(numAddsHint int)

Source from the content-addressed store, hash-verified

273// NewArrayBuilder returns an ArrayBuilder. The builder will reserve spaces
274// based on hint about number of adds to reduce times of growing capacity.
275func NewArrayBuilder(numAddsHint int) *ArrayBuilder {
276 return &ArrayBuilder{
277 jsons: make([]JSON, 0, numAddsHint),
278 }
279}
280
281// Add appends JSON to the sequence.
282func (b *ArrayBuilder) Add(j JSON) {

Callers 5

AsJSONFunction · 0.92
RemoveStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…