![]() # Objective - The implementation of `update_component_access` for `AnyOf`/`Or` is kinda weird due to special casing the first filter, let's simplify it; - Fundamentally we want to fold/reduce the various filters using an OR operation, however in order to do a proper fold we need a neutral element for the initial accumulator, which for OR is FALSE. However we didn't have a way to create a `FilteredAccess` value corresponding to FALSE and thus the only option was reducing, which special cases the first element as being the initial accumulator. This is an alternative to https://github.com/bevyengine/bevy/pull/14026 ## Solution - Introduce `FilteredAccess::empty` as a way to create a `FilteredAccess` corresponding to the logical proposition FALSE; - Use it as the initial accumulator for the above operations, allowing to handle all the elements to fold in the same way. --- ## Migration Guide - The behaviour of `AnyOf<()>` and `Or<()>` has been changed to match no archetypes rather than all archetypes to naturally match the corresponding logical operation. Consider replacing them with `()` instead. |
||
---|---|---|
.. | ||
commands | ||
adapter_system.rs | ||
builder.rs | ||
combinator.rs | ||
exclusive_function_system.rs | ||
exclusive_system_param.rs | ||
function_system.rs | ||
mod.rs | ||
observer_system.rs | ||
query.rs | ||
system_name.rs | ||
system_param.rs | ||
system_registry.rs | ||
system.rs |