News for hackers. Stuff that matters.
Re:Branchless Coding in Go by gnum4n on Wednesday May 05, 2021 @02:58AM (#27046978)
In that case, the code would probably work like the C code example I gave. So... I guess you're right. It _can_ be done in Go without `if` if we use unsafe. I can't argue with that =)

In general, I try to to avoid using unsafe as much as possible. Not because I worry that it's "unsafe" or prone to errors (I'm experienced in C, C++, and assembly), but because it makes the code harder to read, and I don't think my coworkers would appreciate that. ;)

There are no comments on this comment yet.