Handle the case where the same entity is queued for removal multiple times.
Undo that earlier const auto -> const auto& change, because we are storing an iterator there. It's legal, because const& extends lifetime, but if we do any destructive operations on that container, the iterator becomes invalid, so it's safer to just make a copy.
const auto
->const auto&
change, because we are storing an iterator there. It's legal, becauseconst&
extends lifetime, but if we do any destructive operations on that container, the iterator becomes invalid, so it's safer to just make a copy.