Skip to content

Commit

Permalink
Remove outdated perf comments (#4374)
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
DJMcNab committed Mar 31, 2022
1 parent 3af90b6 commit aca7fc1
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,6 @@ impl World {
/// and those default values will be here instead.
#[inline]
pub fn init_resource<R: Resource + FromWorld>(&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::<R>() {
let resource = R::from_world(self);
self.insert_resource(resource);
Expand Down Expand Up @@ -635,9 +632,6 @@ impl World {
/// and those default values will be here instead.
#[inline]
pub fn init_non_send_resource<R: 'static + FromWorld>(&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::<R>() {
let resource = R::from_world(self);
self.insert_non_send_resource(resource);
Expand Down

0 comments on commit aca7fc1

Please sign in to comment.