diff options
| author | Opportunity <[email protected]> | 2020-01-18 21:17:56 +0800 |
|---|---|---|
| committer | Opportunity <[email protected]> | 2020-01-19 13:01:09 +0800 |
| commit | c4c151b8b05ff57a71199fd7cdea6b8b3b5bbd15 (patch) | |
| tree | c7d7d4a3d8a57324865f76babc4e78e8c70b8d9c | |
| parent | faca684d1ec62de7bc3e56224c986ab24533f4fa (diff) | |
fix
| -rw-r--r-- | xmake/core/base/bytes.lua | 1 | ||||
| -rw-r--r-- | 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 |
