From 93f764e1003bb6f35b56b7b91a73ae0ca80282c9 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 10 Aug 2024 18:50:45 +0200 Subject: refactor(ecs): create archetype lookup entries on-the-go --- ecs/src/query.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'ecs/src/query.rs') diff --git a/ecs/src/query.rs b/ecs/src/query.rs index 60d4210..ea61640 100644 --- a/ecs/src/query.rs +++ b/ecs/src/query.rs @@ -20,7 +20,7 @@ use crate::system::{ Param as SystemParam, System, }; -use crate::{World, WorldData}; +use crate::World; pub mod options; @@ -138,27 +138,6 @@ where { Box::new(QueryComponentIds { component_ids: Comps::metadata() }) } - - #[cfg_attr(feature = "debug", tracing::instrument(skip_all))] - fn prepare(world_data: &WorldData) - { - let mut component_storage_lock = world_data - .component_storage - .write_nonblock() - .expect("Failed to acquire read-write component storage lock"); - - #[cfg(feature = "debug")] - tracing::debug!( - "Adding archetypes lookup entry for components: ({})", - std::any::type_name::() - ); - - component_storage_lock.add_archetype_lookup_entry(Comps::metadata()); - - drop(component_storage_lock); - - Comps::prepare(world_data); - } } type ComponentIterMapFn = for<'a> fn(&'a Archetype) -> EntityIter<'a>; -- cgit v1.2.3-18-g5258