Skip to content

Commit

Permalink
inline get & get_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jul 27, 2021
1 parent c6bad70 commit dcb10e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_ecs/src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ impl Entities {
/// Access the location storage of an entity.
///
/// Must not be called on pending entities.
#[inline]
pub fn get_mut(&mut self, entity: Entity) -> Option<&mut EntityLocation> {
let meta = &mut self.meta[entity.id as usize];
if meta.generation == entity.generation {
Expand All @@ -354,6 +355,7 @@ impl Entities {
}

/// Returns `Ok(Location { archetype: 0, index: undefined })` for pending entities.
#[inline]
pub fn get(&self, entity: Entity) -> Option<EntityLocation> {
if (entity.id as usize) < self.meta.len() {
let meta = &self.meta[entity.id as usize];
Expand Down

0 comments on commit dcb10e1

Please sign in to comment.