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

Method operation

src/function/list/list_reverse_function.cpp:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9struct ListReverse {
10 static inline void operation(common::list_entry_t& input, common::list_entry_t& result,
11 common::ValueVector& inputVector, common::ValueVector& resultVector) {
12 auto inputDataVector = common::ListVector::getDataVector(&inputVector);
13 ListVector::resizeDataVector(&resultVector, ListVector::getDataVectorSize(&inputVector));
14 auto resultDataVector = common::ListVector::getDataVector(&resultVector);
15 result = input; // reverse does not change
16 for (auto i = 0u; i < input.size; i++) {
17 auto pos = input.offset + i;
18 auto reversePos = input.offset + input.size - 1 - i;
19 resultDataVector->copyFromVectorData(reversePos, inputDataVector, pos);
20 }
21 }
22};
23
24static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) {

Callers

nothing calls this directly

Calls 4

resizeDataVectorFunction · 0.85
getDataVectorSizeFunction · 0.85
copyFromVectorDataMethod · 0.80
getDataVectorFunction · 0.50

Tested by

no test coverage detected