summaryrefslogtreecommitdiff
path: root/locale/zh-tw/meta.lua
diff options
context:
space:
mode:
authorC3pa <41503714+C3pa@users.noreply.github.com>2022-05-12 16:19:08 +0200
committerC3pa <41503714+C3pa@users.noreply.github.com>2022-05-12 16:19:08 +0200
commit88a3cd6f3b63524dff77850cad876e679547b504 (patch)
tree68b1529670078212519b46c24da391c9d8e66890 /locale/zh-tw/meta.lua
parente069d28762467969596a66ace8b5cde34427c8a0 (diff)
downloadlua-language-server-88a3cd6f3b63524dff77850cad876e679547b504.zip
Implement support for LuaJIT's `table.new` and `table.clear`
Diffstat (limited to 'locale/zh-tw/meta.lua')
-rw-r--r--locale/zh-tw/meta.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/locale/zh-tw/meta.lua b/locale/zh-tw/meta.lua
index d6ec50d3..61d3f239 100644
--- a/locale/zh-tw/meta.lua
+++ b/locale/zh-tw/meta.lua
@@ -734,6 +734,19 @@ table.foreachi =
'走訪表中的每一個元素,並以索引號index和value執行回呼函式。如果回呼函式回傳一個非nil值則循環終止,並且回傳這個值。該函式等同ipair(list),比ipair(list)更慢。不推薦使用'
table.getn =
'回傳表的長度。該函式等價於#list。'
+table.new = -- TODO: need translate!
+[[This creates a pre-sized table, just like the C API equivalent `lua_createtable()`. This is useful for big tables if the final table size is known and automatic table resizing is too expensive. `narray` parameter specifies the number of array-like items, and `nhash` parameter specifies the number of hash-like items. The function needs to be required before use.
+```lua
+ require("table.new")
+```
+]]
+table.clear = -- TODO: need translate!
+[[This clears all keys and values from a table, but preserves the allocated array/hash sizes. This is useful when a table, which is linked from multiple places, needs to be cleared and/or when recycling a table for use by the same context. This avoids managing backlinks, saves an allocation and the overhead of incremental array/hash part growth. The function needs to be required before use.
+```lua
+ require("table.clear").
+```
+Please note this function is meant for very specific situations. In most cases it's better to replace the (usually single) link with a new table and let the GC do its work.
+]]
utf8 =
''