lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In message <BB6EE26A.11CBA%ando@spritec.com>, Ando Sonenblick writes:
> 
> By the way, found out that
> 
> if x == nil then
> 
> Is pretty significantly slower than:
> 
> if not x then

Watch out, because this isn't a generally correct transformation.

The two fragments have different meanings.  They are different in
the case when x == false for example.

By the way, in my experience if one is optimising lua code at this sort of
level one has usually missed some richer vein of optimisation.

Cheers,
 drj