Skip to content

Commit

Permalink
remove comments referring to type when untyped pointer is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobhellermann committed Nov 15, 2022
1 parent dd4add3 commit 62da22d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/bevy_ecs/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Storages {
let table = &self.tables[archetype.table_id()];
let components = table.get_column(component_id)?;
let table_row = archetype.entity_table_row(location.index);
// SAFETY: archetypes only store valid table_rows and the stored component type is T
// SAFETY: archetypes only store valid table_rows and caller ensure aliasing rules
Some(unsafe {
(
components.get_data_unchecked(table_row),
Expand Down Expand Up @@ -131,7 +131,7 @@ impl Storages {
let table = &self.tables[archetype.table_id()];
let components = table.get_column(component_id)?;
let table_row = archetype.entity_table_row(location.index);
// SAFETY: archetypes only store valid table_rows and the stored component type is T
// SAFETY: archetypes only store valid table_rows and caller ensure aliasing rules
Some(unsafe { components.get_data_unchecked(table_row) })
}
StorageType::SparseSet => self
Expand Down Expand Up @@ -187,7 +187,7 @@ impl Storages {
let table = &self.tables[archetype.table_id()];
let components = table.get_column(component_id)?;
let table_row = archetype.entity_table_row(location.index);
// SAFETY: archetypes only store valid table_rows and the stored component type is T
// SAFETY: archetypes only store valid table_rows and caller ensure aliasing rules
Some(unsafe { components.get_ticks_unchecked(table_row) })
}
StorageType::SparseSet => self
Expand Down Expand Up @@ -230,7 +230,7 @@ impl Storages {
// SAFETY: archetypes will always point to valid columns
let components = table.get_column_mut(component_id).unwrap();
let table_row = archetype.entity_table_row(location.index);
// SAFETY: archetypes only store valid table_rows and the stored component type is T
// SAFETY: archetypes only store valid table_rows
// SAFETY: promote is safe because the caller promises to remove the table row without dropping it immediately afterwards
components.get_data_unchecked_mut(table_row).promote()
}
Expand Down

0 comments on commit 62da22d

Please sign in to comment.