File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -272,9 +272,9 @@ impl Archetype {
272272 fn grow ( & mut self , increment : usize ) {
273273 unsafe {
274274 let old_count = self . len ;
275- let count = old_count + increment;
275+ let new_capacity = self . capacity ( ) + increment;
276276 self . entities . resize (
277- self . entities . len ( ) + increment ,
277+ new_capacity ,
278278 Entity {
279279 id : u32:: MAX ,
280280 generation : u32:: MAX ,
@@ -284,7 +284,7 @@ impl Archetype {
284284 for type_state in self . state . values_mut ( ) {
285285 type_state
286286 . component_flags
287- . resize_with ( count , ComponentFlags :: empty) ;
287+ . resize_with ( new_capacity , ComponentFlags :: empty) ;
288288 }
289289
290290 let old_data_size = mem:: replace ( & mut self . data_size , 0 ) ;
@@ -294,7 +294,7 @@ impl Archetype {
294294 let ty_state = self . state . get_mut ( & ty. id ) . unwrap ( ) ;
295295 old_offsets. push ( ty_state. offset ) ;
296296 ty_state. offset = self . data_size ;
297- self . data_size += ty. layout . size ( ) * count ;
297+ self . data_size += ty. layout . size ( ) * new_capacity ;
298298 }
299299 let new_data = if self . data_size == 0 {
300300 NonNull :: dangling ( )
You can’t perform that action at this time.
0 commit comments