[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How can we make lua better?
- From: Klaus Ripke <paul-lua@...>
- Date: Mon, 28 Feb 2005 19:27:13 +0100
On Monday 28 February 2005 19:07, David Olofson wrote:
> > In a case like this, I use this:
> > y = 2
> > if a then y = 1 end
> > Only two, no 'else' and no chance of a var depending on a
> > conditional branch merely for its prior existence...
> Right, that's the universal solution; works with pretty much every
> language. The only problem is that it's kind of wasteful if the
> assignment is more expensive than loading a value into a register or
tests showed this about equally fast as if..y=..else y=,
if a is false, and about 10% slower, if a is true
(all variables being local)