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

Function concat

test/api/udf_test.cpp:415–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415static void concat(const string_t& left, const string_t& right, string_t& result,
416 ValueVector& resultValueVector) {
417 result.len = left.len + right.len;
418 if (result.len <= string_t::SHORT_STR_LENGTH /* concat result is short */) {
419 memcpy(result.prefix, left.getData(), left.len);
420 memcpy(result.prefix + left.len, right.getData(), right.len);
421 } else {
422 StringVector::reserveString(&resultValueVector, result, result.len);
423 auto buffer = reinterpret_cast<char*>(result.overflowPtr);
424 memcpy(buffer, left.getData(), left.len);
425 memcpy(buffer + left.len, right.getData(), right.len);
426 memcpy(result.prefix, buffer, string_t::PREFIX_LENGTH);
427 }
428}
429
430struct ConditionalConcat {
431 static inline void operation(string_t& a, bool& b, string_t& c, string_t& result,

Callers 1

operationMethod · 0.85

Calls 1

getDataMethod · 0.45

Tested by

no test coverage detected