Commit 6eeee3f3 authored by Dominik Charousset's avatar Dominik Charousset

Fix streaming of variants

parent 99b4e077
......@@ -82,15 +82,15 @@ public:
using type = detail::decay_t<decltype(*i)>;
// Ship full batches.
while (std::distance(i, e) >= desired_batch_size) {
std::vector<type> tmp{std::make_move_iterator(i),
std::make_move_iterator(i + desired_batch_size)};
std::vector<type> tmp(std::make_move_iterator(i),
std::make_move_iterator(i + desired_batch_size));
emit_batch(self, desired_batch_size, make_message(std::move(tmp)));
i += desired_batch_size;
}
// Ship underful batch only if `force_underful` is set.
if (i != e && force_underfull) {
std::vector<type> tmp{std::make_move_iterator(i),
std::make_move_iterator(e)};
std::vector<type> tmp(std::make_move_iterator(i),
std::make_move_iterator(e));
auto tmp_size = static_cast<int32_t>(tmp.size());
emit_batch(self, tmp_size, make_message(std::move(tmp)));
return e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment