Skip to content

Commit

Permalink
Fix: std::remove_if called without erase
Browse files Browse the repository at this point in the history
  • Loading branch information
OfekShilon committed Dec 2, 2023
1 parent c6507fd commit 383dc08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gen_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ void GenPolicy::uniformProbFromMax(std::vector<Probability<T>> &distr,

template <class T, class U>
void GenPolicy::removeProbability(std::vector<Probability<T>> &orig, U id) {
std::remove_if(
auto new_end = std::remove_if(
orig.begin(), orig.end(),
[&id](Probability<T> &elem) -> bool { return elem.getId() == id; });
orig.erase(new_end, orig.end());
}

0 comments on commit 383dc08

Please sign in to comment.