MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Add

Method Add

postgres/parser/json/json.go:280–284  ·  view source on GitHub ↗

Add appends key value pair to the sequence and updates amount of memory allocated for the overall keys and values.

(k string, v JSON)

Source from the content-addressed store, hash-verified

278// Add appends key value pair to the sequence and updates
279// amount of memory allocated for the overall keys and values.
280func (b *ObjectBuilderWithCounter) Add(k string, v JSON) {
281 b.ob.Add(k, v)
282 // Size of added JSON + overhead of storing key/value pair + the size of the key.
283 b.size += v.Size() + keyValuePairSize + uintptr(len(k))
284}
285
286// Build returns a JSON object built from a key value pair sequence. After that,
287// it should not be modified any longer.

Callers

nothing calls this directly

Calls 2

SizeMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected