Skip to content

Commit

Permalink
Review items
Browse files Browse the repository at this point in the history
  • Loading branch information
Suficio committed Jan 29, 2023
1 parent 7798b4d commit 360e855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ impl Bundles {
&mut self,
components: &mut Components,
component_id: ComponentId,
) -> (&BundleInfo, &StorageType) {
) -> (&BundleInfo, StorageType) {
let bundle_infos = &mut self.bundle_infos;
let (bundle_id, storage_types) = self
.dynamic_component_bundle_ids
Expand All @@ -786,7 +786,7 @@ impl Bundles {
// SAFETY: index either exists, or was initialized
let bundle_info = unsafe { bundle_infos.get_unchecked(bundle_id.0) };

(bundle_info, storage_types)
(bundle_info, *storage_types)
}
}

Expand Down
6 changes: 4 additions & 2 deletions crates/bevy_ecs/src/world/entity_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl<'w> EntityMut<'w> {
self.entity,
self.location,
Some(component).into_iter(),
Some(*storage_type).into_iter(),
Some(storage_type).into_iter(),
);

self
Expand All @@ -324,6 +324,8 @@ impl<'w> EntityMut<'w> {
/// You should prefer to use the typed API [`EntityMut::insert`] where possible.
/// If your [`Bundle`] only has one component, use the cached API [`EntityMut::insert_by_id`].
///
/// If possible, pass a sorted slice of `ComponentId` to maximize caching potential.
///
/// # Safety
/// - Each [`ComponentId`] must be from the same world as [`EntityMut`]
/// - Each [`OwningPtr`] must be a valid reference to the type represented by [`ComponentId`]
Expand Down Expand Up @@ -352,7 +354,7 @@ impl<'w> EntityMut<'w> {
self.entity,
self.location,
iter_components,
storage_types.iter().map(Clone::clone),
storage_types.iter().cloned(),
);

self
Expand Down

0 comments on commit 360e855

Please sign in to comment.