lua-users home
lua-l archive

Re: Speed of # operator (Was: ipairs in Lua 5.3.0-alpha)

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


2014年08月15日 3:43 GMT+02:00 Jan Behrens <jbe-lua-l@public-software-group.org>:
> Here, t->sizearray is not equal to #t, is it?
Oops, you are right.
Still, as Roberto pointed out [1], the O(log n) cost of #t (which
is all in C, no calls, only macros -- this I have checked!) is
likely to be less than the O(1) cost of a Lua function call.
[1] http://lua-users.org/lists/lua-l/2014-08/msg00421.html

AltStyle によって変換されたページ (->オリジナル) /