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

Method Size

postgres/parser/json/json.go:700–711  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

698}
699
700func (j jsonObject) Size() uintptr {
701 valSize := sliceHeaderSize + uintptr(cap(j))*keyValuePairSize
702 // jsonKeyValuePair consists of jsonString(i.e. string header) k and JSON interface v.
703 // Since elem.k.Size() has already taken stringHeaderSize into account, we should
704 // reduce len(j) * stringHeaderSize to avoid counting the size of string headers twice
705 valSize -= uintptr(len(j)) * stringHeaderSize
706 for _, elem := range j {
707 valSize += elem.k.Size()
708 valSize += elem.v.Size()
709 }
710 return valSize
711}
712
713// ParseJSON takes a string of JSON and returns a JSON value.
714func ParseJSON(s string) (JSON, error) {

Callers

nothing calls this directly

Calls 1

SizeMethod · 0.65

Tested by

no test coverage detected