summaryrefslogtreecommitdiff
path: root/xmake/core/base/table.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-26 00:49:24 +0800
committerruki <[email protected]>2022-10-26 00:49:24 +0800
commitb2e2ec485d38261f4e54a42f3da052ad8c73c915 (patch)
tree6499da14c2491ef7208f3588563809185d0b7c26 /xmake/core/base/table.lua
parentd40e9406911279e9182e4605b3565aef7e225ddb (diff)
improve table.orderpairs
Diffstat (limited to 'xmake/core/base/table.lua')
-rw-r--r--xmake/core/base/table.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index a360f7b42..84caf1bfa 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -440,6 +440,9 @@ end
-- TODO
-- end
function table.orderpairs(t)
+ if type(t) ~= "table" then
+ t = t ~= nil and {t} or {}
+ end
local orderkeys = table.orderkeys(t)
local i = 1
return function (t, k)