@JPL There’s not a lot that can be said about either snippet of code without broader context. I’d advise bringing this type of “code review” question to its own post, or some other more appropriate forum.
At any rate, either one is likely to generate fairly optimal code. Switches can often be optimized into jump tables, or even LUTs (lookup tables), which are only a few instructions. In the LUT case, you may even be able to appease the CPU branch predictor by avoiding having a branch there in the first place.
Although one recommendation I might make is, if possible, to consider formulating the second one like:
I think you’re right, I leave the second solution which is very readable especially when you have to dive back into the code.
Because good code also means thinking about tomorrow.