Fix identifier order in container. It must be linear

This commit is contained in:
Constantin Shalnev 2015-11-27 15:37:20 +03:00
parent 87ce05a48e
commit 398cd5444f

View file

@ -64,12 +64,6 @@ uint32_t GpsTrackContainer::AddPoint(m2::PointD const & point, double speedMPS,
{
lock_guard<mutex> lg(m_guard);
GpsTrackPoint gtp;
gtp.m_timestamp = timestamp;
gtp.m_point = point;
gtp.m_speedMPS = speedMPS;
gtp.m_id = ++m_counter;
// Do not process points which are come with timestamp earlier than timestamp of the last point
// because it is probably some error in logic or gps error, because valid gps must provide UTC time which is growing.
if (!m_points.empty() && timestamp < m_points.back().m_timestamp)
@ -78,6 +72,12 @@ uint32_t GpsTrackContainer::AddPoint(m2::PointD const & point, double speedMPS,
return kInvalidId;
}
GpsTrackPoint gtp;
gtp.m_timestamp = timestamp;
gtp.m_point = point;
gtp.m_speedMPS = speedMPS;
gtp.m_id = ++m_counter;
m_points.push_back(gtp);
vector<GpsTrackPoint> added;