Skip to content

Commit

Permalink
Use non-atomic reads of change_tick.
Browse files Browse the repository at this point in the history
  • Loading branch information
chescock committed Mar 11, 2023
1 parent 53de75a commit 50470da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_ecs/src/query/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,12 @@ impl<Q: WorldQuery, F: ReadOnlyWorldQuery> QueryState<Q, F> {
#[inline]
pub fn par_iter_mut<'w, 's>(&'s mut self, world: &'w mut World) -> QueryParIter<'w, 's, Q, F> {
self.update_archetypes(world);
let this_run = world.change_tick();
QueryParIter {
world,
state: self,
last_run: world.last_change_tick(),
this_run: world.read_change_tick(),
this_run,
batching_strategy: BatchingStrategy::new(),
}
}
Expand Down

0 comments on commit 50470da

Please sign in to comment.