Skip to content

Commit 73d65dc

Browse files
committed
table.create
1 parent 641d7cb commit 73d65dc

File tree

7 files changed

+20
-0
lines changed

7 files changed

+20
-0
lines changed

locale/en-us/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,8 @@ table =
712712
''
713713
table.concat =
714714
'Given a list where all elements are strings or numbers, returns the string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
715+
table.create =
716+
'Creates a new empty table, preallocating memory. This preallocation may help performance and save memory when you know in advance how many elements the table will have. Parameter `nseq` is a hint for how many elements the table will have as a sequence. Optional parameter `nrec` is a hint for how many other elements the table will have; its default is zero.'
715717
table.insert =
716718
'Inserts element `value` at position `pos` in `list`.'
717719
table.maxn =

locale/es-419/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ table =
693693
''
694694
table.concat =
695695
'Dada una lista donde todos los elementos son strings o números, retorna el string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
696+
table.create =
697+
'Crea una nueva tabla vacía, preasignando memoria. Esta preasignación puede ayudar al rendimiento y ahorrar memoria cuando conoces de antemano cuántos elementos tendrá la tabla. El parámetro `nseq` es una pista de cuántos elementos tendrá la tabla como secuencia. El parámetro opcional `nrec` es una pista de cuántos otros elementos tendrá la tabla; su valor predeterminado es cero.'
696698
table.insert =
697699
'Inserta el elemento `value` en la posición `pos` en la lista `list`.'
698700
table.maxn =

locale/ja-jp/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@ table =
686686
''
687687
table.concat =
688688
'すべての要素が文字列または数値であるリストに対して、`list[i]..sep..list[i+1] ··· sep..list[j]` という文字列を返す。'
689+
table.create =
690+
'新しい空のテーブルを作成し、メモリを事前に割り当てます。テーブルに含まれる要素数を事前に知っている場合、この事前割り当てによりパフォーマンスの向上とメモリの節約が期待できます。パラメータ `nseq` はテーブルがシーケンスとして持つ要素数のヒントです。オプションのパラメータ `nrec` はテーブルが持つその他の要素数のヒントで、デフォルトは0です。'
689691
table.insert =
690692
'要素 `value` を `list` の位置 `pos` に挿入する。'
691693
table.maxn =

locale/pt-br/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ table =
693693
''
694694
table.concat =
695695
'Dada uma lista onde todos os elementos são strings ou números, retorna a string `list[i]..sep..list[i+1] ··· sep..list[j]`.'
696+
table.create =
697+
'Cria uma nova tabela vazia, pré-alocando memória. Esta pré-alocação pode ajudar no desempenho e economizar memória quando você souber com antecedência quantos elementos a tabela terá. O parâmetro `nseq` é uma dica para quantos elementos a tabela terá como sequência. O parâmetro opcional `nrec` é uma dica para quantos outros elementos a tabela terá; seu padrão é zero.'
696698
table.insert =
697699
'Insere o elemento `value` na posição `pos` de `list`.'
698700
table.maxn =

locale/zh-cn/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,8 @@ table =
671671
''
672672
table.concat =
673673
'提供一个列表,其所有元素都是字符串或数字,返回字符串 `list[i]..sep..list[i+1] ··· sep..list[j]`。'
674+
table.create =
675+
'创建一个新的空表,预分配内存。当您预先知道表将有多少元素时,这种预分配可能有助于性能和节省内存。参数 `nseq` 是表作为序列将有多少元素的提示。可选参数 `nrec` 是表将有多少其他元素的提示;默认值为零。'
674676
table.insert =
675677
'在 `list` 的位置 `pos` 处插入元素 `value`。'
676678
table.maxn =

locale/zh-tw/meta.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,8 @@ table =
676676
''
677677
table.concat =
678678
'提供一個列表,其所有元素都是字串或數字,回傳字串 `list[i]..sep..list[i+1] ··· sep..list[j]`。'
679+
table.create =
680+
'建立一個新的空表,預先配置記憶體。當您預先知道表將有多少元素時,這種預先配置可能有助於效能和節省記憶體。參數 `nseq` 是表作為序列將有多少元素的提示。可選參數 `nrec` 是表將有多少其他元素的提示;預設值為零。'
679681
table.insert =
680682
'在 `list` 的位置 `pos` 處插入元素 `value`。'
681683
table.maxn =

meta/template/table.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ table = {}
1313
---@nodiscard
1414
function table.concat(list, sep, i, j) end
1515

16+
---@version >5.5
17+
---#DES 'table.create'
18+
---@param nseq integer
19+
---@param nrec? integer
20+
---@return table
21+
---@nodiscard
22+
function table.create(nseq, nrec) end
23+
1624
---#DES 'table.insert'
1725
---@overload fun(list: table, value: any)
1826
---@param list table

0 commit comments

Comments
 (0)