Hi Ian,

Yes, sorry I forgot to specify I was using the standard go compiler.
Thank you for your answer!



Le sam. 21 déc. 2019 à 07:49, Ian Lance Taylor <i...@golang.org> a écrit :

> On Fri, Dec 20, 2019 at 5:07 PM Michel Levieux <m.levi...@capitaldata.fr>
> wrote:
> >
> > 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?
>
> Well, there are multiple Go compilers and it depends on the compiler,
> but for the standard Go compiler you can download at golang.org, yes,
> those conditions are eliminated at compile time.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CANgi3347D%3D6FV4be-hRWt4-0%3DO3-eTsQgiLexaZ0ZiVFeMsTMA%40mail.gmail.com.

Reply via email to