From 2f07cd115f2e65133e7147a77a8385b8ddf52fea Mon Sep 17 00:00:00 2001 From: Roman Sorokin Date: Tue, 5 Aug 2014 12:33:32 +0300 Subject: [PATCH] method FromArray removed, the same code used in constructor now --- geometry/spline.cpp | 7 ++----- geometry/spline.hpp | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/geometry/spline.cpp b/geometry/spline.cpp index 217c6ae1e1..64ba61cfe8 100644 --- a/geometry/spline.cpp +++ b/geometry/spline.cpp @@ -3,14 +3,11 @@ namespace m2 { -void Spline::FromArray(vector const & path) +Spline::Spline(vector const & path) { - if (path.empty()) - return; + ASSERT(path.size() > 1, ("Wrong path size!")); m_position.assign(path.begin(), path.end()); int cnt = m_position.size() - 1; - if (cnt == 0) - return; m_direction = vector(cnt); m_length = vector(cnt); diff --git a/geometry/spline.hpp b/geometry/spline.hpp index 90cdf180e7..d5985e482d 100644 --- a/geometry/spline.hpp +++ b/geometry/spline.hpp @@ -30,8 +30,7 @@ public: public: Spline() : m_lengthAll(0.0f) {} - Spline(vector const & path) { FromArray(path); } - void FromArray(vector const & path); + Spline(vector const & path); void AddPoint(PointF const & pt); Spline const & operator = (Spline const & spl); float GetLength() const { return m_lengthAll; }