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.
()
| 45 | // been decoded, otherwise it returns nil. This allows us to fast-path certain |
| 46 | // operations if we've already done the work of decoding an object. |
| 47 | func (j *jsonEncoded) alreadyDecoded() JSON { |
| 48 | j.mu.RLock() |
| 49 | defer j.mu.RUnlock() |
| 50 | if j.mu.cachedDecoded != nil { |
| 51 | return j.mu.cachedDecoded |
| 52 | } |
| 53 | return nil |
| 54 | } |
| 55 | |
| 56 | func (j *jsonEncoded) Type() Type { |
| 57 | return j.typ |
no outgoing calls
no test coverage detected