Skip to content
Snippets Groups Projects
Commit f10f1b2e authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Minor optim for data channel

parent d4adec78
No related branches found
No related tags found
No related merge requests found
Pipeline #18445 passed
...@@ -477,8 +477,10 @@ void Frame::create(ftl::codecs::Channel channel, const T &value) { ...@@ -477,8 +477,10 @@ void Frame::create(ftl::codecs::Channel channel, const T &value) {
if (static_cast<int>(channel) < static_cast<int>(ftl::codecs::Channel::Data)) throw ftl::exception("Cannot use generic type with non data channel"); if (static_cast<int>(channel) < static_cast<int>(ftl::codecs::Channel::Data)) throw ftl::exception("Cannot use generic type with non data channel");
data_channels_ += channel; data_channels_ += channel;
data_data_.insert({static_cast<int>(channel),{}});
ftl::util::FTLVectorBuffer buf(data_data_[static_cast<int>(channel)]); auto &v = *std::get<0>(data_data_.insert({static_cast<int>(channel),{}}));
v.second.resize(0);
ftl::util::FTLVectorBuffer buf(v.second);
msgpack::pack(buf, value); msgpack::pack(buf, value);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment