summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-14 12:09:53 +0800
committerruki <[email protected]>2020-11-14 12:09:53 +0800
commit3c8c6c7b59e336e32e51507547f6f3a49ec1567d (patch)
treed5f1c93c232bf033f7a2ac0102e5371d0e008e39
parent43f18cb49b592b1a234fc553b1276fbeffc099c9 (diff)
table.orderkeys
-rw-r--r--xmake/core/base/table.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index 27e6ecb3c..9fb64b114 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -309,6 +309,13 @@ function table.keys(tab)
return keyset, n
end
+-- get order keys of a table
+function table.orderkeys(tab)
+ local keys = table.keys(tab)
+ table.sort(keys)
+ return keys
+end
+
-- get values of a table
function table.values(tab)