File tree 1 file changed +7
-4
lines changed
crates/bevy_ecs/src/query
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -80,17 +80,20 @@ where
80
80
}
81
81
82
82
pub fn new_archetype ( & mut self , archetype : & Archetype ) {
83
- let table_index = archetype. table_id ( ) . index ( ) ;
84
83
if self . fetch_state . matches_archetype ( archetype)
85
84
&& self . filter_state . matches_archetype ( archetype)
86
85
{
87
86
self . fetch_state
88
87
. update_archetype_component_access ( archetype, & mut self . archetype_component_access ) ;
89
88
self . filter_state
90
89
. update_archetype_component_access ( archetype, & mut self . archetype_component_access ) ;
91
- self . matched_archetypes . grow ( archetype. id ( ) . index ( ) + 1 ) ;
92
- self . matched_archetypes . set ( archetype. id ( ) . index ( ) , true ) ;
93
- self . matched_archetype_ids . push ( archetype. id ( ) ) ;
90
+ let archetype_index = archetype. id ( ) . index ( ) ;
91
+ if !self . matched_archetypes . contains ( archetype_index) {
92
+ self . matched_archetypes . grow ( archetype_index + 1 ) ;
93
+ self . matched_archetypes . set ( archetype_index, true ) ;
94
+ self . matched_archetype_ids . push ( archetype. id ( ) ) ;
95
+ }
96
+ let table_index = archetype. table_id ( ) . index ( ) ;
94
97
if !self . matched_tables . contains ( table_index) {
95
98
self . matched_tables . grow ( table_index + 1 ) ;
96
99
self . matched_tables . set ( table_index, true ) ;
You can’t perform that action at this time.
0 commit comments