From 3fd39cf892250545b4510065fe16e39d494faa44 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Dec 2018 08:05:57 +0100 Subject: cruft only --- spline/spline.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'spline') diff --git a/spline/spline.cpp b/spline/spline.cpp index cd3daf30..752e85d1 100644 --- a/spline/spline.cpp +++ b/spline/spline.cpp @@ -367,8 +367,6 @@ void spline::ensure_valid(points_t& list) { QMutexLocker foo(&_mutex); - // storing to s->points fires bundle::changed and that leads to an infinite loop - // thus, only store if we can't help it std::stable_sort(list.begin(), list.end(), sort_fn); const int sz = list.size(); @@ -406,26 +404,24 @@ void spline::ensure_valid(points_t& list) } } - // size check guards against livelock with value/bundle_ signals + // simply storing to s->points fires bundle::changed leading to a livelock + // hence only store if we can't help it - // points that are within bounds if (tmp.size() < points.size()) { + // all points that don't overlap points = std::move(tmp); - // can't stuff there unconditionally - // fires signals from `value' and `bundle_' otherwise s->points = points; } if (all_points.size() < list.size()) - // all points that don't overlap, after clamping + // points that are within currently-specified bounds list = std::move(all_points); last_input_value = {}; activep = false; } -// the return value is only safe to use with no spline::set_bundle calls std::shared_ptr spline::get_settings() { QMutexLocker foo(&_mutex); @@ -460,13 +456,9 @@ void spline::disconnect_signals() { if (conn_changed) { - QObject::disconnect(conn_changed); - QObject::disconnect(conn_maxx); - QObject::disconnect(conn_maxy); - - conn_changed = {}; - conn_maxx = {}; - conn_maxy = {}; + QObject::disconnect(conn_changed), conn_changed = {}; + QObject::disconnect(conn_maxx), conn_maxx = {}; + QObject::disconnect(conn_maxy), conn_maxy = {}; } } -- cgit v1.2.3