lua-users home
lua-l archive

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


On Mon, Nov 23, 2020 at 11:26 PM Luiz Henrique de Figueiredo wrote:
It seems to me that the issue, if any, is creating new entries in a
table, not assigning nils.

Yes.
When nil is assigned to a non-existing key, a table rehash may be triggered as if a new element was inserted.
This behaviour is obviously wrong.
Table rehashing is a very expensive operation, so it's worth adding a check on nil here.

Correct behaviour:
Nothing should be done if nil is assigned to a non-existing key.