Skip to content

Commit

Permalink
#37 Removed if and assert from apply renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
carljohnsen committed Aug 7, 2024
1 parent b9cad30 commit ed415e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/cpp/cpu/connected_components.cc
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,9 @@ void apply_renaming(std::vector<int64_t> &img, std::vector<int64_t> &to_rename)
void apply_renaming(int64_t *__restrict__ img, const int64_t n, const std::vector<int64_t> &to_rename) {
#pragma omp parallel for schedule(static)
for (int64_t i = 0; i < n; i++) {
assert (img[i] < (int64_t) to_rename.size() && "Label out of bounds");
if (img[i] < (int64_t) to_rename.size()) {
// TODO Make into a debug macro
//assert (img[i] < (int64_t) to_rename.size() && "Label out of bounds");
img[i] = to_rename[img[i]];
}
}
}

Expand Down

0 comments on commit ed415e1

Please sign in to comment.