-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add drain_filter for SlotMap #77
Comments
Rather than https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.drain_filter So: fn update_players(world: &mut World, players: &mut SlotMap<PlayerKey, Player>) {
players.drain_filter(|(player_key, player)| {
player.update(world);
if player.is_dead() {
player.deinit(world);
return true;
}
false
});
} |
Yes, |
Just for the record, |
How is this issue going? Do you need help? |
I have been very busy and not always as productive the last year and a bit. I'd like to move this into slotmap 2, which I'm expecting to start working on Soon:tm:, after winding down my current work on glidesort and another library I'm releasing soon. |
I've seen glidesort, great job! I will follow updates and news here and there. What do you think about adding "help wanted" notes on this and other repositories? I am sure that many people would like to help you. |
@starovoid The annoying part is that I've been meaning to rewrite slotmap for a while now, and that any help at this stage would be ultimately counterproductive to both parties. I understand this is frustrating if you want features on a certain timeline, so I'm sorry for that. |
FWIW, the standard library changed the name; it's currently Would also love to see this (here and in the std collections). |
Would it be reasonable to add an API that allows this?
In contrast to the Entry API of the secondary maps, this Entry API would provide access to only the occupied slots. I think it should be possible to implement this. If wished I would provide a PR.
The text was updated successfully, but these errors were encountered: