Skip to content

Commit aca7fc1

Browse files
committed
Remove outdated perf comments (#4374)
# Objective - The perf comments, added (by me) in #1349, became outdated once the initialisation call started to take an exclusive reference, (presumably in #1525). - They have been naïvely transferred along ever since ## Solution - Remove them
1 parent 3af90b6 commit aca7fc1

File tree

1 file changed

+0
-6
lines changed
  • crates/bevy_ecs/src/world

1 file changed

+0
-6
lines changed

crates/bevy_ecs/src/world/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,6 @@ impl World {
605605
/// and those default values will be here instead.
606606
#[inline]
607607
pub fn init_resource<R: Resource + FromWorld>(&mut self) {
608-
// PERF: We could avoid double hashing here, since the `from_world` call is guaranteed
609-
// not to modify the map. However, we would need to be borrowing resources both
610-
// mutably and immutably, so we would need to be extremely certain this is correct
611608
if !self.contains_resource::<R>() {
612609
let resource = R::from_world(self);
613610
self.insert_resource(resource);
@@ -635,9 +632,6 @@ impl World {
635632
/// and those default values will be here instead.
636633
#[inline]
637634
pub fn init_non_send_resource<R: 'static + FromWorld>(&mut self) {
638-
// PERF: We could avoid double hashing here, since the `from_world` call is guaranteed
639-
// not to modify the map. However, we would need to be borrowing resources both
640-
// mutably and immutably, so we would need to be extremely certain this is correct
641635
if !self.contains_resource::<R>() {
642636
let resource = R::from_world(self);
643637
self.insert_non_send_resource(resource);

0 commit comments

Comments
 (0)