Note: this function takes in a 1-based begin/end index (The index of the first value in the listEntry is 1).
| 30 | // Note: this function takes in a 1-based begin/end index (The index of the first value in the |
| 31 | // listEntry is 1). |
| 32 | static void operation(list_entry_t& listEntry, int64_t& begin, int64_t& end, |
| 33 | list_entry_t& result, ValueVector& listVector, ValueVector& resultVector) { |
| 34 | auto startIdx = begin; |
| 35 | auto endIdx = end; |
| 36 | normalizeIndices(startIdx, endIdx, listEntry.size); |
| 37 | result = ListVector::addList(&resultVector, endIdx - startIdx + 1); |
| 38 | auto srcDataVector = ListVector::getDataVector(&listVector); |
| 39 | auto srcPos = listEntry.offset + startIdx - 1; |
| 40 | auto dstDataVector = ListVector::getDataVector(&resultVector); |
| 41 | auto dstPos = result.offset; |
| 42 | for (; startIdx <= endIdx; startIdx++) { |
| 43 | dstDataVector->copyFromVectorData(dstPos++, srcDataVector, srcPos++); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | static void operation(string_t& str, int64_t& begin, int64_t& end, string_t& result, |
| 48 | ValueVector&, ValueVector& resultValueVector) { |
nothing calls this directly
no test coverage detected