summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-26 09:59:13 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-26 09:59:13 +0200
commit1fb157e31c404489e6aef58288ad0d75fb5e1640 (patch)
tree87cf1e3974a9647cd84d7030d2f9b6ed02986f19 /qfunctionconfigurator
parent52f67dee52a484e8a2eed0c527777c1d341a2294 (diff)
qfc: lift computation out of loop
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp3
1 files changed, 2 insertions, 1 deletions
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<int>(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;