From 1fb157e31c404489e6aef58288ad0d75fb5e1640 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Jul 2015 09:59:13 +0200 Subject: qfc: lift computation out of loop --- qfunctionconfigurator/functionconfig.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qfunctionconfigurator') diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp index 2a44cba0..38a9e703 100644 --- a/qfunctionconfigurator/functionconfig.cpp +++ b/qfunctionconfigurator/functionconfig.cpp @@ -107,9 +107,10 @@ void Map::reload() { const int mult_ = mult * 20; int end = std::min(sz, p2.x() * mult_); int start = p1.x() * mult; + const n max = end - start; for (int j = start; j < end; j++) { - n t = (j - start) / (n) (end - start); + n t = (j - start) / max; n t2 = t*t; n t3 = t*t*t; -- cgit v1.2.3