diff options
| author | ruki <[email protected]> | 2020-11-14 12:10:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-14 12:10:28 +0800 |
| commit | 5643311ff8d29840261853b4b21c653d169b0b8f (patch) | |
| tree | acbf39e40fe583cc46354a1583d78530b07a34eb | |
| parent | 3c8c6c7b59e336e32e51507547f6f3a49ec1567d (diff) | |
use table.orderkeys
| -rw-r--r-- | xmake/actions/config/menuconf.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/xmake/actions/config/menuconf.lua b/xmake/actions/config/menuconf.lua index 0489ef8fa..67cb1fe69 100644 --- a/xmake/actions/config/menuconf.lua +++ b/xmake/actions/config/menuconf.lua @@ -133,8 +133,7 @@ function app:_make_configs_by_category(root, options_by_category, cache, get_opt -- local menus = {} local configs = {} - local categories = table.keys(options_by_category) - table.sort(categories) + local categories = table.orderkeys(options_by_category) for _, category in ipairs(categories) do -- get or make menu by category @@ -213,8 +212,7 @@ function app:_basic_configs(cache) local category = "." local options = menu and menu.options or {} local options_by_category = {} - local keys = table.keys(options) - table.sort(keys) + local keys = table.orderkeys(options) for _, key in ipairs(keys) do local opt = options[key] local name = opt[2] or opt[1] @@ -286,8 +284,7 @@ function app:_project_configs(cache) -- merge options by category local options = project.options() local options_by_category = {} - local keys = table.keys(options) - table.sort(keys) + local keys = table.orderkeys(options) for _, key in ipairs(keys) do local opt = options[key] if opt:get("showmenu") then |
