[generator] use std::move instead of copy

This commit is contained in:
Mikhail Gorbushin 2019-08-29 18:33:11 +03:00 committed by Maksim Andrianov
parent 317f06ec74
commit 9501bc26be
2 changed files with 3 additions and 5 deletions

View file

@ -3,11 +3,9 @@
#include "generator/holes.hpp"
#include "generator/osm2type.hpp"
#include "generator/osm_element.hpp"
#include "generator/type_helper.hpp"
#include "indexer/classificator.hpp"
#include "indexer/feature_visibility.hpp"
#include "indexer/ftypes_matcher.hpp"
#include <utility>
@ -80,7 +78,7 @@ bool FeatureMakerSimple::BuildFromRelation(OsmElement & p, FeatureParams const &
auto const & holesGeometry = helper.GetHoles();
auto & outer = helper.GetOuter();
auto const size = m_queue.size();
auto const func = [&](FeatureBuilder::PointSeq const & pts, std::vector<uint64_t> const & ids)
auto func = [&](FeatureBuilder::PointSeq const & pts, std::vector<uint64_t> const & ids)
{
FeatureBuilder fb;
for (uint64_t id : ids)
@ -99,7 +97,7 @@ bool FeatureMakerSimple::BuildFromRelation(OsmElement & p, FeatureParams const &
m_queue.push(std::move(fb));
};
outer.ForEachArea(true /* collectID */, func);
outer.ForEachArea(true /* collectID */, std::move(func));
return size != m_queue.size();
}

View file

@ -25,7 +25,7 @@ public:
void AddWay(uint64_t id);
template <class ToDo>
void ForEachArea(bool collectID, ToDo toDo)
void ForEachArea(bool collectID, ToDo && toDo)
{
while (!m_map.empty())
{