Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-07-27 10:54:53 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2016-07-27 10:54:53 +0300
commit3d20b30646fb6360ba72eb922b07965a97c040c1 (patch)
tree075c71b57306a10d5f2175c1ab6388e75f71fa63
parent8041ea570c9c80cc4515a4bcf1978981d53f65ea (diff)
Geting rid of unnecessary copying of vector<TAltitude>.
-rw-r--r--indexer/altitude_loader.cpp7
-rw-r--r--indexer/feature_altitude.hpp2
2 files changed, 3 insertions, 6 deletions
diff --git a/indexer/altitude_loader.cpp b/indexer/altitude_loader.cpp
index 7624ae2d33..302c9dff55 100644
--- a/indexer/altitude_loader.cpp
+++ b/indexer/altitude_loader.cpp
@@ -87,16 +87,15 @@ TAltitudes const & AltitudeLoader::GetAltitudes(uint32_t featureId, size_t point
src.Skip(altitudeInfoOffsetInSection);
altitudes.Deserialize(m_header.m_minAltitude, pointCount, src);
- TAltitudes pntAlt = altitudes.GetAltitudes();
- bool const isResultValid = none_of(pntAlt.begin(), pntAlt.end(),
+ bool const isResultValid = none_of(altitudes.m_altitudes.begin(), altitudes.m_altitudes.end(),
[](TAltitude a) { return a == kInvalidAltitude; });
if (!isResultValid)
{
- ASSERT(false, (pntAlt));
+ ASSERT(false, (altitudes.m_altitudes));
return m_cache.insert(make_pair(featureId, TAltitudes(pointCount, m_header.m_minAltitude))).first->second;
}
- return m_cache.insert(make_pair(featureId, move(pntAlt))).first->second;
+ return m_cache.insert(make_pair(featureId, move(altitudes.m_altitudes))).first->second;
}
catch (Reader::OpenException const & e)
{
diff --git a/indexer/feature_altitude.hpp b/indexer/feature_altitude.hpp
index 45874fc5ff..a32c9a12ad 100644
--- a/indexer/feature_altitude.hpp
+++ b/indexer/feature_altitude.hpp
@@ -115,8 +115,6 @@ public:
}
}
- TAltitudes GetAltitudes() const { return m_altitudes; }
-private:
/// \note |m_altitudes| is a vector of feature point altitudes. There's two possibilities:
/// * |m_altitudes| is empty. It means there is no altitude information for this feature.
/// * size of |m_pointAlt| is equal to the number of this feature's points. If so