Skip to content

Commit

Permalink
removed unneeded changes to deferred_world
Browse files Browse the repository at this point in the history
Thanks @chescock!
  • Loading branch information
ElliottjPierce committed Feb 24, 2025
1 parent bedea0b commit fe23d37
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions crates/bevy_ecs/src/world/deferred_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,7 @@ impl<'w> DeferredWorld<'w> {
if archetype.has_add_hook() {
for component_id in targets {
// SAFETY: Caller ensures that these components exist
let info = unsafe { self.components().get_info_unchecked(component_id) };
let hooks = info.hooks();
let hooks = unsafe { self.components().get_info_unchecked(component_id) }.hooks();
if let Some(hook) = hooks.on_add {
hook(
DeferredWorld { world: self.world },
Expand Down Expand Up @@ -538,8 +537,7 @@ impl<'w> DeferredWorld<'w> {
if archetype.has_insert_hook() {
for component_id in targets {
// SAFETY: Caller ensures that these components exist
let info = unsafe { self.components().get_info_unchecked(component_id) };
let hooks = info.hooks();
let hooks = unsafe { self.components().get_info_unchecked(component_id) }.hooks();
if let Some(hook) = hooks.on_insert {
hook(
DeferredWorld { world: self.world },
Expand Down Expand Up @@ -569,8 +567,7 @@ impl<'w> DeferredWorld<'w> {
if archetype.has_replace_hook() {
for component_id in targets {
// SAFETY: Caller ensures that these components exist
let info = unsafe { self.components().get_info_unchecked(component_id) };
let hooks = info.hooks();
let hooks = unsafe { self.components().get_info_unchecked(component_id) }.hooks();
if let Some(hook) = hooks.on_replace {
hook(
DeferredWorld { world: self.world },
Expand Down Expand Up @@ -600,8 +597,7 @@ impl<'w> DeferredWorld<'w> {
if archetype.has_remove_hook() {
for component_id in targets {
// SAFETY: Caller ensures that these components exist
let info = unsafe { self.components().get_info_unchecked(component_id) };
let hooks = info.hooks();
let hooks = unsafe { self.components().get_info_unchecked(component_id) }.hooks();
if let Some(hook) = hooks.on_remove {
hook(
DeferredWorld { world: self.world },
Expand Down Expand Up @@ -631,8 +627,7 @@ impl<'w> DeferredWorld<'w> {
if archetype.has_despawn_hook() {
for component_id in targets {
// SAFETY: Caller ensures that these components exist
let info = unsafe { self.components().get_info_unchecked(component_id) };
let hooks = info.hooks();
let hooks = unsafe { self.components().get_info_unchecked(component_id) }.hooks();
if let Some(hook) = hooks.on_despawn {
hook(
DeferredWorld { world: self.world },
Expand Down

0 comments on commit fe23d37

Please sign in to comment.