@@ -20,9 +20,6 @@ pub fn parent_update_system(
20
20
}
21
21
}
22
22
23
- // Tracks all newly created `Children` Components this frame.
24
- let mut children_additions = HashMap :: < Entity , SmallVec < [ Entity ; 8 ] > > :: default ( ) ;
25
-
26
23
// Entities with a changed Parent (that also have a PreviousParent, even if None)
27
24
for ( entity, parent, possible_previous_parent) in parent_query. iter_mut ( ) {
28
25
if let Some ( mut previous_parent) = possible_previous_parent {
@@ -41,31 +38,7 @@ pub fn parent_update_system(
41
38
} else {
42
39
commands. insert_one ( entity, PreviousParent ( parent. 0 ) ) ;
43
40
} ;
44
-
45
- // Add to the parent's `Children` (either the real component, or
46
- // `children_additions`).
47
- if let Ok ( mut new_parent_children) = children_query. get_mut ( parent. 0 ) {
48
- // This is the parent
49
- debug_assert ! (
50
- !( * new_parent_children) . 0 . contains( & entity) ,
51
- "children already added"
52
- ) ;
53
- ( * new_parent_children) . 0 . push ( entity) ;
54
- } else {
55
- // The parent doesn't have a children entity, lets add it
56
- children_additions
57
- . entry ( parent. 0 )
58
- . or_insert_with ( Default :: default)
59
- . push ( entity) ;
60
- }
61
41
}
62
-
63
- // Flush the `children_additions` to the command buffer. It is stored separate to
64
- // collect multiple new children that point to the same parent into the same
65
- // SmallVec, and to prevent redundant add+remove operations.
66
- children_additions. iter ( ) . for_each ( |( k, v) | {
67
- commands. insert_one ( * k, Children :: with ( v) ) ;
68
- } ) ;
69
42
}
70
43
#[ cfg( test) ]
71
44
mod test {
0 commit comments