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.
()
| 59 | // been decoded, otherwise it returns nil. This allows us to fast-path certain |
| 60 | // operations if we've already done the work of decoding an object. |
| 61 | func (j *jsonEncoded) alreadyDecoded() JSON { |
| 62 | j.mu.RLock() |
| 63 | defer j.mu.RUnlock() |
| 64 | if j.mu.cachedDecoded != nil { |
| 65 | return j.mu.cachedDecoded |
| 66 | } |
| 67 | return nil |
| 68 | } |
| 69 | |
| 70 | func (j *jsonEncoded) Type() Type { |
| 71 | return j.typ |
no outgoing calls
no test coverage detected