Remove redundant bounds check in Entities::get (#8108)
This commit is contained in:
parent
4a62afb97b
commit
f3d6c2d90b
@ -571,8 +571,7 @@ impl Entities {
|
||||
/// Returns the location of an [`Entity`].
|
||||
/// Note: for pending entities, returns `Some(EntityLocation::INVALID)`.
|
||||
pub fn get(&self, entity: Entity) -> Option<EntityLocation> {
|
||||
if (entity.index as usize) < self.meta.len() {
|
||||
let meta = &self.meta[entity.index as usize];
|
||||
if let Some(meta) = self.meta.get(entity.index as usize) {
|
||||
if meta.generation != entity.generation
|
||||
|| meta.location.archetype_id == ArchetypeId::INVALID
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user