-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Prototype Indexing #1587
Prototype Indexing #1587
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably need to handle removed components with a second exclusive system in the last stage
} | ||
pub struct ActiveIndexed<'a, T: Component + Eq + Hash + Clone> { | ||
indexed: &'a mut Indexed<'a, T>, | ||
orig_value: T, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to store its hash instead and drop the Clone bound, but HashMap::raw_entry()
is not stable. Maybe we could use hashbrown: https://docs.rs/hashbrown/0.9.1/hashbrown/hash_map/struct.HashMap.html#method.raw_entry_mut
Closing, might reimplement in a separate PR once #2254 lands. |
Indexing is a highly requested feature (#1205) that we currently don't have an answer to. This PR implements one possible version of indexing, by eagerly updating the index to ensure it's always valid.