From 51695d62b6dbf65abfb24631f6dd74523dcd9f08 Mon Sep 17 00:00:00 2001 From: Daniel Armbruster Date: Wed, 17 Aug 2022 21:26:12 +0000 Subject: [PATCH] BUG: Correctly create mask Note that this bug was introduced with a1d8ce843ac81a09b82cc4930fc60a7ca639a80f. That is, while improving the arrival offset validation performance wise. --- src/apps/cc/detector/linker/pot.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/apps/cc/detector/linker/pot.cpp b/src/apps/cc/detector/linker/pot.cpp index 9e29d060..f5d4d44b 100644 --- a/src/apps/cc/detector/linker/pot.cpp +++ b/src/apps/cc/detector/linker/pot.cpp @@ -146,19 +146,18 @@ bool POT::validateEnabledOffsets(const std::string &processorId, return false; } + std::vector commonMask(size()); // create mask with common enabled processors - std::vector common_mask(size(), false); size_type i{0}; - for (const auto &p : _processorIdxMap) { - if (p.second.enabled && otherMask[i]) { - common_mask[i++] = true; - } + for (const auto &idxPair : _processorIdxMap) { + commonMask[i] = idxPair.second.enabled && otherMask[i]; + ++i; } const auto &offsets{_offsets[std::distance(_processorIdxMap.begin(), it)]}; for (size_type i{0}; i < size(); ++i) { - if (common_mask[i] && validEntry(otherOffsets[i]) && + if (commonMask[i] && validEntry(otherOffsets[i]) && validEntry(offsets[i]) && util::greaterThan(std::abs(offsets[i] - otherOffsets[i]), static_cast(thres), tolerance)) {