reserve std::vector capacity prior oppending + remove const qualifier
This commit is contained in:
parent
8b049230b3
commit
f3cd36f0cd
1 changed files with 4 additions and 1 deletions
|
@ -226,12 +226,15 @@ auto push_geometry = [] (auto const& ctx)
|
||||||
auto push_collection = [] (auto const& ctx)
|
auto push_collection = [] (auto const& ctx)
|
||||||
{
|
{
|
||||||
auto & dest = _val(ctx);
|
auto & dest = _val(ctx);
|
||||||
auto const& src = _attr(ctx);
|
auto & src = _attr(ctx);
|
||||||
if (dest.empty()) dest = std::move(src);
|
if (dest.empty()) dest = std::move(src);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
dest.reserve(dest.size() + src.size());
|
||||||
dest.insert(std::end(dest),
|
dest.insert(std::end(dest),
|
||||||
std::make_move_iterator(std::begin(src)),
|
std::make_move_iterator(std::begin(src)),
|
||||||
std::make_move_iterator(std::end(src)));
|
std::make_move_iterator(std::end(src)));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue