MCPcopy
hub / github.com/uber/aresdb / IsValid

Method IsValid

memstore/common/data_value.go:754–758  ·  view source on GitHub ↗

IsValid check if the item in index-th place is valid or not

(index int)

Source from the content-addressed store, hash-verified

752
753// IsValid check if the item in index-th place is valid or not
754func (reader *ArrayValueReader) IsValid(index int) bool {
755 nilOffset := CalculateListNilOffset(reader.itemType, int(reader.length))
756 nilByte := *(*byte)(unsafe.Pointer(uintptr(reader.value) + uintptr(nilOffset) + uintptr(index/8)))
757 return nilByte&(0x1<<uint8(index%8)) != 0x0
758}
759
760// CalculateListElementBytes returns the total size in bytes needs to be allocated for a list type column for a single
761// row along with the validity vector start.

Calls 1

CalculateListNilOffsetFunction · 0.85

Tested by

no test coverage detected