Added two comments. One suppresses a specific warning, the other explains exactly why that warning is wrong in this very particular case where the code does exactly what is expected.

Follow

I could have written the code in a way that didn't trigger the warning which the compiler probably would turn it into the same thing, but it wouldn't be much different in SLOC from my comment and I think overall clarity would have been worse. I don't want to disable the warning more broadly, however, as it does indicate something that is almost always a mistake.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Typica Social

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!