summaryrefslogtreecommitdiffhomepage
path: root/qfunctionconfigurator/functionconfig.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-05 20:47:32 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-05 20:50:22 +0200
commit7581608afa596e3ab64fa312361fccf5cc409450 (patch)
tree1cdc01fd43eb0093166089ed2beb0234ba5f9549 /qfunctionconfigurator/functionconfig.cpp
parent1e10164eb7b66988e0404890239af7b7c1543395 (diff)
cleanup some useless logic
Diffstat (limited to 'qfunctionconfigurator/functionconfig.cpp')
-rw-r--r--qfunctionconfigurator/functionconfig.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp
index 69522da9..6db3b55f 100644
--- a/qfunctionconfigurator/functionconfig.cpp
+++ b/qfunctionconfigurator/functionconfig.cpp
@@ -34,7 +34,7 @@ Map::Map() :
float Map::getValue(float x) {
QMutexLocker foo(&_mutex);
- int x2 = (int) (std::min<float>(std::max<float>(x, -360), 360) * MEMOIZE_PRECISION);
+ int x2 = x * (double) MEMOIZE_PRECISION;
float ret = getValueInternal(x2);
last_input_value.setX(x);
last_input_value.setY(ret);
@@ -55,7 +55,7 @@ float Map::getValueInternal(int x) {
if (sz == 0)
ret = 0;
else
- ret = std::max(std::min(x, sz-1), 0);
+ ret = data[std::max(std::min(x, sz-1), 0)];
return ret * sign;
}