diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-01 15:42:08 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-01 15:42:08 -0300 |
| commit | 8047b2d03eaaeee44871a11f8d3a3135f2639b1a (patch) | |
| tree | 2b2d246e2c63ba0accd7c3463a0d331669abe1ef /testes | |
| parent | ee645472ebe153e2c6669c84a632297a8110bdb6 (diff) | |
| download | lua-8047b2d03eaaeee44871a11f8d3a3135f2639b1a.tar.gz lua-8047b2d03eaaeee44871a11f8d3a3135f2639b1a.tar.bz2 lua-8047b2d03eaaeee44871a11f8d3a3135f2639b1a.zip | |
Tables have a 'lastfree' information only when needed
Only tables with some minimum number of entries in their hash part
have a 'lastfree' field, kept in a header before the node vector.
Diffstat (limited to 'testes')
| -rw-r--r-- | testes/nextvar.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/nextvar.lua b/testes/nextvar.lua index 0874e5bb..80b3d05c 100644 --- a/testes/nextvar.lua +++ b/testes/nextvar.lua | |||
| @@ -210,9 +210,9 @@ assert(T.querytab(a) == 64) -- array part has 64 elements | |||
| 210 | a[32] = true; a[48] = true; -- binary search will find these ones | 210 | a[32] = true; a[48] = true; -- binary search will find these ones |
| 211 | a[51] = true -- binary search will miss this one | 211 | a[51] = true -- binary search will miss this one |
| 212 | assert(#a == 48) -- this will set the limit | 212 | assert(#a == 48) -- this will set the limit |
| 213 | assert(select(4, T.querytab(a)) == 48) -- this is the limit now | 213 | assert(select(3, T.querytab(a)) == 48) -- this is the limit now |
| 214 | a[50] = true -- this will set a new limit | 214 | a[50] = true -- this will set a new limit |
| 215 | assert(select(4, T.querytab(a)) == 50) -- this is the limit now | 215 | assert(select(3, T.querytab(a)) == 50) -- this is the limit now |
| 216 | -- but the size is larger (and still inside the array part) | 216 | -- but the size is larger (and still inside the array part) |
| 217 | assert(#a == 51) | 217 | assert(#a == 51) |
| 218 | 218 | ||
