From c4c151b8b05ff57a71199fd7cdea6b8b3b5bbd15 Mon Sep 17 00:00:00 2001 From: Opportunity Date: Sat, 18 Jan 2020 21:17:56 +0800 Subject: fix --- xmake/core/base/bytes.lua | 1 - xmake/modules/private/utils/complete.lua | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/xmake/core/base/bytes.lua b/xmake/core/base/bytes.lua index 3776695a1..54343a962 100644 --- a/xmake/core/base/bytes.lua +++ b/xmake/core/base/bytes.lua @@ -65,7 +65,6 @@ function _instance.new(...) else -- bytes(size): allocates a buffer of given size ptr = ffi.C.malloc(size) - ffi.fill(ptr, size, 0) instance._CDATA = ffi.gc(ffi.cast("unsigned char*", ptr), ffi.C.free) instance._MANAGED = true end diff --git a/xmake/modules/private/utils/complete.lua b/xmake/modules/private/utils/complete.lua index cbe40bc29..781e98367 100644 --- a/xmake/modules/private/utils/complete.lua +++ b/xmake/modules/private/utils/complete.lua @@ -108,7 +108,7 @@ function _complete_option_kv(options, current, completing) return true end - local opcandi = {} + local opcandi = table.new(10, 0) for _, v in ipairs(options) do if current[v[2]] == nil then if v[3] == "kv" or v[3] == "k" then table.insert(opcandi, v) end @@ -213,8 +213,8 @@ end function _complete(argv, completing) - local tasks = {} - local shortnames = {} + local tasks = table.new(10, 0) + local shortnames = table.new(0, 10) for _, v in ipairs(task.names()) do local menu = option.taskmenu(v) tasks[v] = menu -- cgit v1.3.1