diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index f673bdd36cc92..af151daabbdd2 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);