From 9501bc26be2a657f02cc98349fe4d8b774217198 Mon Sep 17 00:00:00 2001 From: Mikhail Gorbushin Date: Thu, 29 Aug 2019 18:33:11 +0300 Subject: [PATCH] [generator] use std::move instead of copy --- generator/feature_maker.cpp | 6 ++---- generator/ways_merger.hpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/generator/feature_maker.cpp b/generator/feature_maker.cpp index bb49a7ef6d..25f84c9ede 100644 --- a/generator/feature_maker.cpp +++ b/generator/feature_maker.cpp @@ -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 @@ -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 const & ids) + auto func = [&](FeatureBuilder::PointSeq const & pts, std::vector 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(); } diff --git a/generator/ways_merger.hpp b/generator/ways_merger.hpp index 1d0afed945..090763c2f3 100644 --- a/generator/ways_merger.hpp +++ b/generator/ways_merger.hpp @@ -25,7 +25,7 @@ public: void AddWay(uint64_t id); template - void ForEachArea(bool collectID, ToDo toDo) + void ForEachArea(bool collectID, ToDo && toDo) { while (!m_map.empty()) {