| 539 | } |
| 540 | |
| 541 | StringVal StringVal::CopyFrom(FunctionContext* ctx, const uint8_t* buf, size_t len) noexcept { |
| 542 | StringVal result; |
| 543 | AllocateStringValWithLenCheck(ctx, len, &result); |
| 544 | if (LIKELY(!result.is_null)) { |
| 545 | std::copy(buf, buf + len, result.ptr); |
| 546 | } |
| 547 | return result; |
| 548 | } |
| 549 | |
| 550 | bool StringVal::Resize(FunctionContext* ctx, int new_len) noexcept { |
| 551 | if (new_len <= len) { |
no outgoing calls