extract common code from a if block (#8959)
Some code could be improved. ## Solution Improve the code
This commit is contained in:
parent
bec299fa6e
commit
4b1a502a49
@ -883,13 +883,11 @@ unsafe fn remove_bundle_from_archetype(
|
|||||||
// check the archetype graph to see if the Bundle has been removed from this archetype in the
|
// check the archetype graph to see if the Bundle has been removed from this archetype in the
|
||||||
// past
|
// past
|
||||||
let remove_bundle_result = {
|
let remove_bundle_result = {
|
||||||
let current_archetype = &mut archetypes[archetype_id];
|
let edges = archetypes[archetype_id].edges();
|
||||||
if intersection {
|
if intersection {
|
||||||
current_archetype
|
edges.get_remove_bundle(bundle_info.id())
|
||||||
.edges()
|
|
||||||
.get_remove_bundle(bundle_info.id())
|
|
||||||
} else {
|
} else {
|
||||||
current_archetype.edges().get_take_bundle(bundle_info.id())
|
edges.get_take_bundle(bundle_info.id())
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let result = if let Some(result) = remove_bundle_result {
|
let result = if let Some(result) = remove_bundle_result {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user