bevy/crates/bevy_reflect/src/enums
rmsthebest 278380394f
Avoid bevy_reflect::List::iter wrapping in release mode (#13271)
# Objective
Fixes  #13230

## Solution
Uses solution described in  #13230
They mention a worry about adding a branch, but I'm not sure there is
one.

This code
```Rust
#[no_mangle]
pub fn next_if_some(num: i32, b: Option<bool>) -> i32 {
    num + b.is_some() as i32
}
```
produces this assembly with opt-level 3
```asm
next_if_some:
        xor     eax, eax
        cmp     sil, 2
        setne   al
        add     eax, edi
        ret
```

## Testing
Added test from #13230, tagged it as ignore as it is only useful in
release mode and very slow if you accidentally invoke it in debug mode.

---

## Changelog
Iterationg of ListIter will no longer overflow and wrap around

## Migration Guide
2024-05-12 15:01:05 +00:00
..
dynamic_enum.rs Finish the work on try_apply (#12646) 2024-05-08 14:26:01 +00:00
enum_trait.rs Avoid bevy_reflect::List::iter wrapping in release mode (#13271) 2024-05-12 15:01:05 +00:00
helpers.rs Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00
mod.rs Finish the work on try_apply (#12646) 2024-05-08 14:26:01 +00:00
variants.rs bevy_reflect: Binary formats (#6140) 2022-11-04 02:22:54 +00:00