[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [5.4] Shrinking of tables
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 6 Jul 2018 09:58:55 -0300
> Is it still the case in Lua 5.4 that the array part of a table is
> never shrunk except possibly when you assign a value to a positive
> integer index outside it?
That was not the case in previous versions and it is not the case in 5.4.
t = {nil, nil, nil, nil}
-- array part has size 4, hash part has size 0
t.a = true -- force a rehash
-- now, array part has size 0, hash part has size 1
-- Roberto