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:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-10-09 14:59:01 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2017-10-17 15:16:05 +0300
commitf3b47f6e4864396c91078985a1f1e3ccdaeeeca0 (patch)
treeb6474353191cadfa7baffeaa56ce47a0abeb6263 /geometry
parentc34018bfb2e1d86594a391ee1229d4a97316028f (diff)
Review fixes
Diffstat (limited to 'geometry')
-rw-r--r--geometry/polyline2d.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/geometry/polyline2d.hpp b/geometry/polyline2d.hpp
index 11b3442b0b..f214b72e4d 100644
--- a/geometry/polyline2d.hpp
+++ b/geometry/polyline2d.hpp
@@ -133,17 +133,15 @@ public:
vector<Point<T>> ExtractSegment(size_t startPointIndex, size_t endPointIndex) const
{
- if (startPointIndex > endPointIndex ||
- startPointIndex + 1 > m_points.size() ||
- endPointIndex + 1 > m_points.size())
+ if (startPointIndex > endPointIndex || startPointIndex >= m_points.size() ||
+ endPointIndex >= m_points.size())
{
return vector<Point<T>>();
}
- vector<Point<T>> result;
- result.reserve(endPointIndex - startPointIndex + 1);
+ vector<Point<T>> result(endPointIndex - startPointIndex + 1);
for (size_t i = startPointIndex; i <= endPointIndex; ++i)
- result.push_back(m_points[i]);
+ result[i] = m_points[i];
return result;
}