From c63688786b535b775cf34c7ad33b3afd238f04bb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 4 Jul 2016 10:36:42 +0200 Subject: spline-widget: sort as defensive coding --- spline-widget/functionconfig.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spline-widget') diff --git a/spline-widget/functionconfig.cpp b/spline-widget/functionconfig.cpp index 915510ca..2ac725f6 100644 --- a/spline-widget/functionconfig.cpp +++ b/spline-widget/functionconfig.cpp @@ -226,8 +226,9 @@ void Map::movePoint(int idx, QPointF pt) if (idx >= 0 && idx < cur.input.size()) { cur.input[idx] = pt; + // we don't allow points to be reordered, but sort due to possible caller logic error + std::stable_sort(cur.input.begin(), cur.input.end(), sortFn); reload(); - // we don't allow points to be reordered, so no sort here } } -- cgit v1.2.3