diff options
-rw-r--r-- | ecs/src/component/storage.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs index e1523df..5098c5f 100644 --- a/ecs/src/component/storage.rs +++ b/ecs/src/component/storage.rs @@ -96,11 +96,13 @@ impl Storage #[cfg(feature = "debug")] tracing::debug!( "Pushing entity with components: ({})", - components - .iter() - .map(|component| component.type_name()) - .collect::<Vec<_>>() - .join(", ") + &components.iter().fold( + String::with_capacity(components.len() * 25), + |mut acc, component| { + acc.extend([", ", component.type_name()]); + acc + } + )[2..] ); let archetype_id = ArchetypeId::from_components_metadata( |