mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
Explicit using clone_from (#14670)
# Objective - after #14502 ,explicit using clone_from should has better performance because it could reuse the resources to avoid unnecessary allocations.
This commit is contained in:
parent
e14f3cf402
commit
66bf160ec5
1 changed files with 2 additions and 2 deletions
|
@ -633,7 +633,7 @@ unsafe impl<'a> WorldQuery for FilteredEntityRef<'a> {
|
|||
|
||||
#[inline]
|
||||
fn set_access<'w>(state: &mut Self::State, access: &FilteredAccess<ComponentId>) {
|
||||
*state = access.clone();
|
||||
state.clone_from(access);
|
||||
state.access_mut().clear_writes();
|
||||
}
|
||||
|
||||
|
@ -746,7 +746,7 @@ unsafe impl<'a> WorldQuery for FilteredEntityMut<'a> {
|
|||
|
||||
#[inline]
|
||||
fn set_access<'w>(state: &mut Self::State, access: &FilteredAccess<ComponentId>) {
|
||||
*state = access.clone();
|
||||
state.clone_from(access);
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Reference in a new issue