diff options
author | Anatoly Serdtcev <serdtcev@maps.me> | 2019-01-31 12:51:04 +0300 |
---|---|---|
committer | Sergey Yershov <syershov@maps.me> | 2019-01-31 16:26:21 +0300 |
commit | cd9d7708ceb1f775080aa138d06b06f84599d765 (patch) | |
tree | b89368edaefcb9596803a404c88909447bad2821 /geocoder | |
parent | 3482321180dd9771433536c34ac7370020ee30c3 (diff) |
[geocoder] Fix result items add
Diffstat (limited to 'geocoder')
-rw-r--r-- | geocoder/geocoder.cpp | 9 | ||||
-rw-r--r-- | geocoder/geocoder.hpp | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/geocoder/geocoder.cpp b/geocoder/geocoder.cpp index 7049ac7a7e..96c6b808bf 100644 --- a/geocoder/geocoder.cpp +++ b/geocoder/geocoder.cpp @@ -133,9 +133,9 @@ bool Geocoder::Context::IsTokenUsed(size_t id) const bool Geocoder::Context::AllTokensUsed() const { return m_numUsedTokens == m_tokens.size(); } void Geocoder::Context::AddResult(base::GeoObjectId const & osmId, double certainty, Type type, - vector<Type> && allTypes, bool allTokensUsed) + vector<Type> const & allTypes, bool allTokensUsed) { - m_beam.Add(BeamKey(osmId, type, move(allTypes), allTokensUsed), certainty); + m_beam.Add(BeamKey(osmId, type, allTypes, allTokensUsed), certainty); } void Geocoder::Context::FillResults(vector<Result> & results) const @@ -271,10 +271,7 @@ void Geocoder::Go(Context & ctx, Type type) const } for (auto const & docId : curLayer.m_entries) - { - ctx.AddResult(m_index.GetDoc(docId).m_osmId, certainty, type, move(allTypes), - ctx.AllTokensUsed()); - } + ctx.AddResult(m_index.GetDoc(docId).m_osmId, certainty, type, allTypes, ctx.AllTokensUsed()); ctx.GetLayers().emplace_back(move(curLayer)); SCOPE_GUARD(pop, [&] { ctx.GetLayers().pop_back(); }); diff --git a/geocoder/geocoder.hpp b/geocoder/geocoder.hpp index f987de5f11..42fe749050 100644 --- a/geocoder/geocoder.hpp +++ b/geocoder/geocoder.hpp @@ -52,7 +52,7 @@ public: public: struct BeamKey { - BeamKey(base::GeoObjectId osmId, Type type, std::vector<Type> && allTypes, bool allTokensUsed) + BeamKey(base::GeoObjectId osmId, Type type, std::vector<Type> const & allTypes, bool allTokensUsed) : m_osmId(osmId) , m_type(type) , m_allTypes(std::move(allTypes)) @@ -88,7 +88,7 @@ public: bool AllTokensUsed() const; void AddResult(base::GeoObjectId const & osmId, double certainty, Type type, - std::vector<Type> && allTypes, bool allTokensUsed); + std::vector<Type> const & allTypes, bool allTokensUsed); void FillResults(std::vector<Result> & results) const; |