Hi everyone,
I was working on a project and for simplicity reasons I just happened to write a lot of useless, effectless conditions.
What I mean by "useless, effectless condition" is a condition that makes no function call, that has no body, and that makes no assignment of any variable outside the scope of the condition. For example, an example of my code would be:
if tracer.detailLevel & macros.TraceDetailLevelMostPossible != 0 {}
Such function could be removed without affecting the execution of the program, algorithmically speaking. Moreover, it seems to me it might be possible to define a relatively small set of rules that identifies such constructs and only those. However when I googled it, I didn't find anything that would answer my question.
So here it is: Is such a condition eliminated at compile-time?
Thx in advance !