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

Method alreadyDecoded

pkg/util/json/encoded.go:44–51  ·  view source on GitHub ↗

alreadyDecoded returns a decoded JSON value if this jsonEncoded has already been decoded, otherwise it returns nil. This allows us to fast-path certain operations if we've already done the work of decoding an object.

()

Source from the content-addressed store, hash-verified

42// been decoded, otherwise it returns nil. This allows us to fast-path certain
43// operations if we've already done the work of decoding an object.
44func (j *jsonEncoded) alreadyDecoded() JSON {
45 j.mu.RLock()
46 defer j.mu.RUnlock()
47 if j.mu.cachedDecoded != nil {
48 return j.mu.cachedDecoded
49 }
50 return nil
51}
52
53func (j *jsonEncoded) Type() Type {
54 return j.typ

Callers 9

FetchValIdxMethod · 0.95
FetchValKeyMethod · 0.95
shallowDecodeMethod · 0.95
AsTextMethod · 0.95
AsDecimalMethod · 0.95
AsBoolMethod · 0.95
AsArrayMethod · 0.95
ExistsMethod · 0.95
preprocessForContainsMethod · 0.95

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected