diff options
Diffstat (limited to 'azalea-world/src')
| -rw-r--r-- | azalea-world/src/entity.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/azalea-world/src/entity.rs b/azalea-world/src/entity.rs index 5219e410..69529294 100644 --- a/azalea-world/src/entity.rs +++ b/azalea-world/src/entity.rs @@ -113,12 +113,7 @@ impl EntityStorage { where F: FnMut(&Entity) -> bool, { - for entity in self.entities() { - if f(entity) { - return Some(entity); - } - } - None + self.entities().find(|&entity| f(entity)) } pub fn find_one_entity_in_chunk<F>(&self, chunk: &ChunkPos, mut f: F) -> Option<&Entity> |
