lua-users home
lua-l archive

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


Creative, Ben, creative.

I tried it out and, while it of course works perfectly well, it is slower
than the old fashioned if-then logic.  And since I'm concentrating on
optimizations right now, the old way wins!

Thx,
Ando

By the way, found out that

if x == nil then

Is pretty significantly slower than:

if not x then

Makes some sense if'n you think on it, but interesting t'know! :)

> Well, to abuse Lua's poor, embattled boolean operators even more than they are
> at present, and toss in a little bit of table-based obfuscation:
> 
> return GetSomeResult() or (GetSomeTable() or {})[key]
> 
> Ben "I'm not an evil programmer, really" Sunshine-Hill
> 
> On Sunday 24 August 2003 08:18 pm, Ando Sonenblick wrote:
>> Gang, can this following code be condensed somehow into a single execution
>> "block" (without making it a subroutine)?

-----------------
SpriTec Software
www.spritec.com