MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / operation

Method operation

src/function/list/list_slice_function.cpp:32–45  ·  view source on GitHub ↗

Note: this function takes in a 1-based begin/end index (The index of the first value in the listEntry is 1).

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 5

normalizeIndicesFunction · 0.85
addListFunction · 0.85
operationFunction · 0.85
copyFromVectorDataMethod · 0.80
getDataVectorFunction · 0.50

Tested by

no test coverage detected