this is a simple test of performance for checking if a uint8 (commonly used for bit flags) is non-zero.
u > 0is the slowest, averaging 1.14ns/op.u != 0is a little faster, averaging 1.13ns/op.- casting
utoboolis the fastest, averaging 0.98ns/op.
note: the third method is unsafe, and only confirmed to work on linux/amd64, where a non-zero byte is truthy.