You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change Bundle::component_ids to return an iterator (#21821)
# Objective
- As part of #21780, I need a way to iterate over the component ids of a
bundle for `Entity*Except` conflict checking without allocating. Pulled
this out as it changes some unrelated code too.
## Solution
- Change `Bundle::component_ids` and `Bundle::get_component_ids` to
return an iterator instead of taking a closure. In theory I would expect
this to compile to the same asm. I would also argue that using an
iterator is a more natural api for this than the closure. It probably
took a closure before because expressing that the iterator doesn't
capture the `&mut ComponentRegistrator` lifetime wasn't possible without
the `use` syntax.
- Removed some #[allow(deprecated)] in the Bundle macro that was missed.
## Testing
- Checked the asm for `hook_on_add` in the observers example for to
confirm it was still the same. This is a pretty simple example though,
so not sure how good of a check this is.
- None of the code touched are in any hot paths, but ran the spawn and
insert benches. Any changes seem to be in the noise.
0 commit comments