diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-03-22 21:56:38 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-03-23 21:40:32 +0100 |
| commit | a9a629f89a1d72130103bd59800e1257af84c97c (patch) | |
| tree | 967ff5eac7b0a8cf355a1c4b525ffbbdc32b1626 /lib/std/multi_array_list.zig | |
| parent | 49051c065120781b6ff78172c447b6307bd01e39 (diff) | |
| download | zig-a9a629f89a1d72130103bd59800e1257af84c97c.tar.gz zig-a9a629f89a1d72130103bd59800e1257af84c97c.zip | |
wasm: Fix switching on errors
Error sets contain the entire global error set.
Users are often switching on specific errors only present within that operand.
This means that cases are almost always sparse and not contiguous.
For this reason, we will instead emit the default case for error values not present in
that specific operand error set. This is fine as those cases will never be hit,
as prevented by the type system.
By still allowing jump tables for those cases, rather than if-else chains, we save runtime cost
as well as binary size.
Diffstat (limited to 'lib/std/multi_array_list.zig')
0 files changed, 0 insertions, 0 deletions
