lua-users home
lua-l archive

Re: snapshot of Lua 4.1 (work)

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


On 2001年11月10日, Peter Shook wrote:
>
> I've noticed a little problem with my common debug idiom of
> foreach(t,print)
> Here is the difference between 4.1 alpha and beta:
>
> [...]
This is a silly bug in the implementation of next :-( The correction is
trivial (I hope):
ltable.c:99 (luaH_index)
 if (0 <= i && i < t->sizearray) { /* is `key' inside array part? */
< return i; /* yes; that's the index */
---
> return i-1; /* yes; that's the index (corrected to C) */
 }
Thank you for the report.
-- Roberto

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