[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: About macro `isvalid` in Lua5.4(work2)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 31 Aug 2018 10:56:15 -0300
> > In my opinion, `ttisnil(&G(L)->nilvalue)` is always true, `(!ttisnil(o) ||
> > o != &G(L)->nilvalue)` can be simplied to `(o != &(G)->nilvalue)`.
> > Of course Roberto is always right. But I can't find my mistake.
> > It confused me for sereval days.
> I guess !ttisnil(o) is cheaper than o != &(G)->nilvalue .
That is right. !ttisnil(o) is cheaper and cover the most common cases.
I will add a comment about that in the source.