[–] tomohawk 4y ago ↗ > We can use a switch with an integer which Go can optimize into a jump table.I wasn't aware that golang switch statements were ever turned into jump tables. But then again, maybe they will be soon?https://go-review.googlesource.com/c/go/+/357330/ [–] cdoxsey 4y ago ↗ Good catch. It seems like they implemented binary search, but not the jump tables yet.
[–] cdoxsey 4y ago ↗ Good catch. It seems like they implemented binary search, but not the jump tables yet.
2 comments
[ 4.3 ms ] story [ 16.0 ms ] threadI wasn't aware that golang switch statements were ever turned into jump tables. But then again, maybe they will be soon?
https://go-review.googlesource.com/c/go/+/357330/