Skip to content

Commit 7d84e5b

Browse files
Update rotate_cubes system to use par_iter_mut() to reduce its impact on performance (#21755)
Quick follow-up to #21745. Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
1 parent a50cd8d commit 7d84e5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/stress_tests/many_cubes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,9 @@ fn rotate_cubes(
547547
mut query: Query<&mut Transform, (With<Mesh3d>, Without<NotShadowCaster>)>,
548548
time: Res<Time>,
549549
) {
550-
for mut transform in query.iter_mut() {
550+
query.par_iter_mut().for_each(|mut transform| {
551551
transform.rotate_y(10.0 * time.delta_secs());
552-
}
552+
});
553553
}
554554

555555
#[inline]

0 commit comments

Comments
 (0)