diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-03-10 17:04:54 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-03-10 18:35:13 +0100 |
commit | b8c1037c67b9ff27f61ca389a05debd3e001d90e (patch) | |
tree | eeff02659c0ee7ccab0d7830ea91eba0baaadaab | |
parent | 5a8949014264203f8429533ffa84f7d40e166554 (diff) |
compat/correlation-calibrator: simplify logic
-rw-r--r-- | compat/correlation-calibrator.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/compat/correlation-calibrator.cpp b/compat/correlation-calibrator.cpp index aef804d2..949f10ae 100644 --- a/compat/correlation-calibrator.cpp +++ b/compat/correlation-calibrator.cpp @@ -1,6 +1,7 @@ #include "correlation-calibrator.hpp" #include "variance.hpp" #include "compat/math.hpp" +#include "compat/meta.hpp" #include <cmath> #include <iterator> @@ -60,22 +61,19 @@ bool correlation_calibrator::check_buckets(const vec6 &data) if (pos[k] >= nbuckets[k]) { - qDebug() << "idx" << k - << "bucket" << (int)pos[k] - << "outside bounds" << nbuckets[k]; + once_only(qDebug() << "idx" << k + << "bucket" << (int)pos[k] + << "outside bounds" << nbuckets[k]);; return false; } if (!buckets[k][pos[k]]) + { ret = true; - - buckets[k][pos[k]] = true; - } - - if (ret) - for (unsigned k = 0; k < 6; k++) buckets[k][pos[k]] = true; + } + } return ret; } |