# wasm: Improve switch implementation · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/557f396f613a416e81116f85c080af8b976fe8cf)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 557f396f613a416e81116f85c080af8b976fe8cf

Requested commit: 557f396f613a416e81116f85c080af8b976fe8cf

Commit: 557f396f613a416e81116f85c080af8b976fe8cf

Tree: 8d3c5564d6bbefde4cd04f2dc670bc726ec0ef95

Author: Luuk de Gram

Committer: Andrew Kelley

## Message

```
wasm: Improve switch implementation

- Implement switching over booleans and pointers.
- Fix sparse-detection where the lowest value was never truly set
as it started at a non-zero number and the case was > 50.
- Fix indexing the jump table by ensuring it starts indexing from 0.

```

## Parents

- [b936fe0a5855872814c9f70f958363f64896217b](https://git.cafe/gitcafe/zig/commit/b936fe0a5855872814c9f70f958363f64896217b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/557f396f613a416e81116f85c080af8b976fe8cf?format=markdown)
