-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Merged by Bors] - Replace World::read_change_ticks
with World::change_ticks
within bevy_ecs
crate
#6816
[Merged by Bors] - Replace World::read_change_ticks
with World::change_ticks
within bevy_ecs
crate
#6816
Conversation
Two questions remain:
|
This is up to you. It doesn't need
Get |
b373c73
to
5409fe3
Compare
@@ -526,9 +516,10 @@ impl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F> { | |||
#[inline] | |||
pub fn iter_mut<'w, 's>(&'s mut self, world: &'w mut World) -> QueryIter<'w, 's, Q, F> { | |||
// SAFETY: query has unique world access | |||
let change_tick = world.change_tick(); | |||
unsafe { | |||
self.update_archetypes(world); |
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.
I'm not familiar with the code at all but I noticed this method isn't unsafe
. Is there a reason to call it inside the unsafe block then?
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's not unsafe and it could be moved out of the unsafe block. Probably not something to be concerned about for this PR though.
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.
Sounds sensible. Should I open a new issue to address this?
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.
No, it's not required, and the code quality benefit isn't too big.
5409fe3
to
7d54c34
Compare
@james7132 I just moved the variables out of the unsafe blocks and left a question in a comment. LMK if it still looks good! Thanks. |
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.
LGTM
bors r+ |
World::read_change_ticks
with World::change_ticks
within bevy_ecs
crateWorld::read_change_ticks
with World::change_ticks
within bevy_ecs
crate
…`bevy_ecs` crate (bevyengine#6816) # Objective - Fixes bevyengine#6812. ## Solution - Replaced `World::read_change_ticks` with `World::change_ticks` within `bevy_ecs` crate in places where `World` references were mutable. ---
…`bevy_ecs` crate (bevyengine#6816) # Objective - Fixes bevyengine#6812. ## Solution - Replaced `World::read_change_ticks` with `World::change_ticks` within `bevy_ecs` crate in places where `World` references were mutable. ---
…`bevy_ecs` crate (bevyengine#6816) # Objective - Fixes bevyengine#6812. ## Solution - Replaced `World::read_change_ticks` with `World::change_ticks` within `bevy_ecs` crate in places where `World` references were mutable. ---
Objective
Solution
World::read_change_ticks
withWorld::change_ticks
withinbevy_ecs
crate in places whereWorld
references were mutable.