From 95875e685b1ee562b218486507837526e3fbed10 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Thu, 31 Mar 2022 20:43:00 +0000 Subject: [PATCH] Remove outdated perf comments (#4374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Objective - The perf comments, added (by me) in https://github.com/bevyengine/bevy/pull/1349, became outdated once the initialisation call started to take an exclusive reference, (presumably in https://github.com/bevyengine/bevy/pull/1525). - They have been naïvely transferred along ever since ## Solution - Remove them --- crates/bevy_ecs/src/world/mod.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index f673bdd36cc92f..af151daabbdd2c 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -605,9 +605,6 @@ impl World { /// and those default values will be here instead. #[inline] pub fn init_resource(&mut self) { - // PERF: We could avoid double hashing here, since the `from_world` call is guaranteed - // not to modify the map. However, we would need to be borrowing resources both - // mutably and immutably, so we would need to be extremely certain this is correct if !self.contains_resource::() { let resource = R::from_world(self); self.insert_resource(resource); @@ -635,9 +632,6 @@ impl World { /// and those default values will be here instead. #[inline] pub fn init_non_send_resource(&mut self) { - // PERF: We could avoid double hashing here, since the `from_world` call is guaranteed - // not to modify the map. However, we would need to be borrowing resources both - // mutably and immutably, so we would need to be extremely certain this is correct if !self.contains_resource::() { let resource = R::from_world(self); self.insert_non_send_resource(resource);