MCPcopy Create free account
hub / github.com/pingcap/tidb / ArrayGetElem

Method ArrayGetElem

pkg/types/json_binary.go:291–293  ·  view source on GitHub ↗

ArrayGetElem gets the element of the index `idx`.

(idx int)

Source from the content-addressed store, hash-verified

289
290// ArrayGetElem gets the element of the index `idx`.
291func (bj BinaryJSON) ArrayGetElem(idx int) BinaryJSON {
292 return bj.valEntryGet(headerSize + idx*valEntrySize)
293}
294
295func (bj BinaryJSON) objectGetKey(i int) []byte {
296 keyOff := int(jsonEndian.Uint32(bj.Value[headerSize+i*keyEntrySize:]))

Callers 15

marshalArrayToMethod · 0.95
HashValueMethod · 0.95
extractToMethod · 0.95
GetElemDepthMethod · 0.95
extractToCallbackMethod · 0.95
WalkMethod · 0.95
jsonArrayExpr2ExprsFunction · 0.80
ArrayInsertMethod · 0.80
doInsertMethod · 0.80
doRemoveMethod · 0.80
CompareBinaryJSONFunction · 0.80
mergeBinaryArrayFunction · 0.80

Calls 1

valEntryGetMethod · 0.95

Tested by

no test coverage detected