Skip to content
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

Item value change #93

Open
Indy2222 opened this issue Oct 17, 2023 · 1 comment
Open

Item value change #93

Indy2222 opened this issue Oct 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Indy2222
Copy link

Add a method to exchange a value of a point.

pub fn exchange(&mut self, query: &[A; K], old_item: T, new_item: T);

Use case:

I have a KdTree with indices to Vec<Slot> because Slot is too large to be efficiently stored directly in the KdTree. When removing an entity, one can efficiently remove it from the Vec with Vec::swap_remove(index) which moves the last slot to index. This creates the need to change the stored index inside KdTree of the moved item.

@sdd sdd added the enhancement New feature or request label Oct 17, 2023
@sdd
Copy link
Owner

sdd commented Oct 17, 2023

Seems like a useful feature - happy to accept a PR for this. I won't have time to get around to implementing this for a while myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants