diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 09:59:13 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 09:59:13 +0200 |
commit | 1fb157e31c404489e6aef58288ad0d75fb5e1640 (patch) | |
tree | 87cf1e3974a9647cd84d7030d2f9b6ed02986f19 /qfunctionconfigurator | |
parent | 52f67dee52a484e8a2eed0c527777c1d341a2294 (diff) |
qfc: lift computation out of loop
Diffstat (limited to 'qfunctionconfigurator')
-rw-r--r-- | qfunctionconfigurator/functionconfig.cpp | 3 |
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; |