refactor(ricepp): use byte_buffer::append()

This commit is contained in:
Marcus Holland-Moritz 2025-04-09 14:31:15 +02:00
parent cb52a2387b
commit a9351e6e08

View File

@ -102,7 +102,6 @@ class ricepp_block_compressor final : public block_compressor::impl {
auto compressed = malloc_byte_buffer::create(); // TODO: make configurable
// TODO: see if we can resize just once...
// TODO: maybe the mutable_byte_buffer interface can have .append()?
{
using namespace ::apache::thrift;
@ -123,8 +122,7 @@ class ricepp_block_compressor final : public block_compressor::impl {
std::string hdrbuf;
CompactSerializer::serialize(hdr, &hdrbuf);
compressed.resize(pos + hdrbuf.size());
::memcpy(compressed.data() + pos, hdrbuf.data(), hdrbuf.size());
compressed.append(hdrbuf.data(), hdrbuf.size());
}
std::span<pixel_type const> input{