diff options
| author | ruki <[email protected]> | 2022-10-26 00:49:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-26 00:49:24 +0800 |
| commit | b2e2ec485d38261f4e54a42f3da052ad8c73c915 (patch) | |
| tree | 6499da14c2491ef7208f3588563809185d0b7c26 /xmake/core/base/table.lua | |
| parent | d40e9406911279e9182e4605b3565aef7e225ddb (diff) | |
improve table.orderpairs
Diffstat (limited to 'xmake/core/base/table.lua')
| -rw-r--r-- | xmake/core/base/table.lua | 3 |
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) |
