Skip to content

Commit

Permalink
use HashMap::retain
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Dec 17, 2022
1 parent 333b754 commit 774154a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/bevy_scene/src/dynamic_scene_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ impl<'w> DynamicSceneBuilder<'w> {
///
/// These were likely created because none of their components were present in the provided type registry upon extraction.
pub fn remove_empty_entities(&mut self) -> &mut Self {
self.extracted_scene = self
.extracted_scene
.drain_filter(|_, entity| !entity.components.is_empty())
.collect();
self.extracted_scene
.retain(|_, entity| !entity.components.is_empty());

self
}
Expand Down

0 comments on commit 774154a

Please sign in to comment.