From b8c1037c67b9ff27f61ca389a05debd3e001d90e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 10 Mar 2018 17:04:54 +0100 Subject: compat/correlation-calibrator: simplify logic --- compat/correlation-calibrator.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'compat/correlation-calibrator.cpp') 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 #include @@ -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; } -- cgit v1.2.3