Skip to content

Commit

Permalink
fewer checks in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hmusta committed Sep 7, 2023
1 parent 2684005 commit 5bb30fd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions metagraph/src/graph/alignment/aligner_seeder_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ It merge_into_mums(const DeBruijnGraph &graph,

if constexpr(std::is_same_v<seed_t, Seed>) {
a_i.expand(std::move(added_nodes));
assert(Alignment(a_i, config).is_valid(graph, &config));
clear_seed(a_j);
}

Expand All @@ -913,14 +912,27 @@ It merge_into_mums(const DeBruijnGraph &graph,
}
assert(inserted_seed.is_valid(graph, &config));
a_i.splice(std::move(inserted_seed));
assert(a_i.is_valid(graph, &config));
assert(a_i.size());
assert(a_i.label_column_diffs.empty());
clear_seed(a_j);
}
}

return std::remove_if(begin, end, [](const auto &a) { return a.empty(); });
end = std::remove_if(begin, end, [](const auto &a) { return a.empty(); });

if constexpr(std::is_same_v<seed_t, Seed>) {
assert(std::all_of(begin, end, [&](const auto &a) {
return Alignment(a, config).is_valid(graph, &config);
}));
}

if constexpr(std::is_same_v<seed_t, Alignment>) {
assert(std::all_of(begin, end, [&](const auto &a) {
return a.is_valid(graph, &config);
}));
}

return end;
}

template Seed* merge_into_mums(const DeBruijnGraph &,
Expand Down

0 comments on commit 5bb30fd

Please sign in to comment.