summaryrefslogtreecommitdiffhomepage
path: root/spline
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-06-26 22:25:22 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-06-26 23:05:21 +0200
commitd65936200a2756e6619a109fa6fa673b91df802e (patch)
tree80b6b6fc7ba9023cbe47290b8ae1bc5468a19bb1 /spline
parent4046773c41ee3c0f65840828ab983cfd13451c85 (diff)
modernize C++ syntax
No visible changes (hopefully).
Diffstat (limited to 'spline')
-rw-r--r--spline/spline.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/spline/spline.cpp b/spline/spline.cpp
index dcd8f5ab..64a9142d 100644
--- a/spline/spline.cpp
+++ b/spline/spline.cpp
@@ -134,7 +134,7 @@ QPointF spline::ensure_in_bounds(const QList<QPointF>& points, int i)
const int sz = points.size();
if (i < 0 || sz == 0)
- return QPointF(0, 0);
+ return {};
if (i < sz)
return points[i];
@@ -168,7 +168,7 @@ void spline::update_interp_data()
const double maxx = max_input();
if (sz == 0)
- list.prepend(QPointF(maxx, max_output()));
+ list.prepend({ maxx, max_output() });
std::stable_sort(list.begin(), list.begin() + sz, sort_fn);
@@ -377,7 +377,7 @@ double spline::max_input() const
{
using m = axis_opts::max_clamp;
const value<m>& clamp = s->opts.clamp_x_;
- if (clamp == m::x1000 && points.size())
+ if (clamp == m::x1000 && !points.empty())
return points[points.size() - 1].x();
return s ? std::fabs(clamp.to<double>()) : 0;
}
@@ -391,7 +391,7 @@ double spline::max_output() const
{
using m = axis_opts::max_clamp;
const value<m>& clamp = s->opts.clamp_y_;
- if (clamp == m::x1000 && points.size())
+ if (clamp == m::x1000 && !points.empty())
return points[points.size() - 1].y();
return s ? std::fabs(clamp.to<double>()) : 0;
}