bevy/crates/bevy_ecs/src/storage
JoJoJet feac2c206c Remove duplicate lookups from Resource initialization (#7174)
# Objective

* `World::init_resource` and `World::get_resource_or_insert_with` are implemented naively, and as such they perform duplicate `TypeId -> ComponentId` lookups.
* `World::get_resource_or_insert_with` contains an additional duplicate `ComponentId -> ResourceData` lookup.
    * This function also contains an unnecessary panic branch, which we rely on the optimizer to be able to remove.

## Solution

Implement the functions using engine-internal code, instead of combining high-level functions. This allows computed variables to persist across different branches, instead of being recomputed.
2023-01-12 23:25:11 +00:00
..
blob_vec.rs Ensure Ptr/PtrMut/OwningPtr are aligned when casting in debug builds (#7117) 2023-01-11 23:12:20 +00:00
mod.rs Panic on dropping NonSend in non-origin thread. (#6534) 2023-01-09 20:40:34 +00:00
resource.rs Remove duplicate lookups from Resource initialization (#7174) 2023-01-12 23:25:11 +00:00
sparse_set.rs Newtype ArchetypeRow and TableRow (#4878) 2022-12-06 01:38:21 +00:00
table.rs Mark TableRow and TableId as repr(transparent) (#7166) 2023-01-11 23:31:22 +00:00