[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua API Help
 
- From: Eric Tetz <erictetz@...>
 
- Date: Mon, 29 Apr 2002 07:33:01 -0700 (PDT)
 
--- Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> >   int lua_iterator_next(lua_State* L)
> >   {
> >     int max = (int) lua_tonumber(L, lua_upvalueindex(1));
> >     int cur = (int) lua_tonumber(L, lua_upvalueindex(2));
> >     [...]
> 
> Have you tried to keep the numbers as "lua_Number"s? The cast from
> float/double to int is slow in some machines...
Wow. That did it! The C code and the Lua code are now the same speed (the C code is a *tiny* bit
faster).
Thanks,
Eric
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com