MCPcopy
hub / github.com/lindb/lindb / SetValue

Method SetValue

pkg/collections/array_list.go:66–81  ·  view source on GitHub ↗

SetValue sets value with pos, if pos out of bounds, return it

(pos int, value float64)

Source from the content-addressed store, hash-verified

64
65// SetValue sets value with pos, if pos out of bounds, return it
66func (f *FloatArray) SetValue(pos int, value float64) {
67 if !f.checkPos(pos) {
68 return
69 }
70 f.values[pos] = value
71
72 if !f.HasValue(pos) {
73 blockIdx := pos / blockSize
74 idx := pos - pos/blockSize*blockSize
75 mark := f.marks[blockIdx]
76 mark |= 1 << uint64(idx)
77 f.marks[blockIdx] = mark
78
79 f.size++
80 }
81}
82
83// IsEmpty tests if array is empty
84func (f *FloatArray) IsEmpty() bool {

Callers 15

TestFloatArrayFunction · 0.95
TestFloatArray_SingleFunction · 0.95
evalMethod · 0.95
TestOrderByRowFunction · 0.95
TestPrimitiveIteratorFunction · 0.95
TestBinary_Eval_SingleFunction · 0.95
TestBinaryEvalFunction · 0.95
generateFloatArrayFunction · 0.95
binaryEvalFunction · 0.95
RateCallFunction · 0.95

Calls 2

checkPosMethod · 0.95
HasValueMethod · 0.95

Tested by 12

TestFloatArrayFunction · 0.76
TestFloatArray_SingleFunction · 0.76
TestOrderByRowFunction · 0.76
TestPrimitiveIteratorFunction · 0.76
TestBinary_Eval_SingleFunction · 0.76
TestBinaryEvalFunction · 0.76
generateFloatArrayFunction · 0.76
makeFloatArrayFunction · 0.76
Test_AvgCallFunction · 0.76
TestRateCallFunction · 0.76