Skip to content

Commit

Permalink
Proper erase-remove in control_unit_killed
Browse files Browse the repository at this point in the history
Eagerly waiting for std::erase in C++20.

Closes #1191.
  • Loading branch information
lmoureaux committed Aug 6, 2022
1 parent 97d99ee commit b1f1881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void control_unit_killed(struct unit *punit)
goto_unit_killed(punit);

auto &focus = get_units_in_focus();
focus.erase(std::find(focus.begin(), focus.end(), punit));
focus.erase(std::remove(focus.begin(), focus.end(), punit), focus.end());
if (get_num_units_in_focus() < 1) {
clear_hover_state();
}
Expand Down

0 comments on commit b1f1881

Please sign in to comment.