Use Linux professionally. Worked with RHEL for years. Current gig uses Debian servers. Daily driver is a system 76 machine with the pop OS that came on it. Debian derivatives make great daily drivers for those of us that just need a browser, terminal, working wifi, and the ability to build and run containers.
Don't need an if, just set the variable and collect the data. Saved you a jump instruction. The compiler is going to optimize it out anyway, but simpler code is better and some people forget the -O flag.
I mean, people have more than one hole for a reason.