From d65936200a2756e6619a109fa6fa673b91df802e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 26 Jun 2018 22:25:22 +0200 Subject: modernize C++ syntax No visible changes (hopefully). --- spline/spline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spline') 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& 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& 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()) : 0; } @@ -391,7 +391,7 @@ double spline::max_output() const { using m = axis_opts::max_clamp; const value& 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()) : 0; } -- cgit v1.2.3