Skip to content

Commit

Permalink
BUG: Correctly create mask
Browse files Browse the repository at this point in the history
Note that this bug was introduced with
a1d8ce8. That is, while improving the
arrival offset validation performance wise.
  • Loading branch information
Daniel Armbruster authored and damb committed Aug 17, 2022
1 parent 65c11e1 commit 51695d6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/apps/cc/detector/linker/pot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,18 @@ bool POT::validateEnabledOffsets(const std::string &processorId,
return false;
}

std::vector<bool> commonMask(size());
// create mask with common enabled processors
std::vector<bool> 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<double>(thres), tolerance)) {
Expand Down

0 comments on commit 51695d6

Please sign in to comment.