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

Function NewObjectBuilder

pkg/util/json/json.go:370–374  ·  view source on GitHub ↗

NewObjectBuilder returns an ObjectBuilder. 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

368// NewObjectBuilder returns an ObjectBuilder. The builder will reserve spaces
369// based on hint about number of adds to reduce times of growing capacity.
370func NewObjectBuilder(numAddsHint int) *ObjectBuilder {
371 return &ObjectBuilder{
372 pairs: make([]jsonKeyValuePair, 0, numAddsHint),
373 }
374}
375
376// Add appends key value pair to the sequence.
377func (b *ObjectBuilder) Add(k string, v JSON) {

Callers 3

AsJSONFunction · 0.92
json.goFile · 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…