Replies: 1 comment
-
Wouldn't this work as an alternative? local preallocated_table = {HashKey = nil, HashKey2 = nil, HashKey3 = nil} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have recently ran in to some cases where it might seem useful to be able to pre-allocate not just the array part of a table using table.create, but also pre-allocating the hash part to a known or desired size.
when doing my research I found that Lua 5.1"s lua_createtable achieves this exact functionality:
https://www.lua.org/manual/5.1/manual.html
Could an additional, perhaps optional, parameter be added to table.create to expose this functionality?
Beta Was this translation helpful? Give feedback.
All reactions