diff options
| author | ruki <[email protected]> | 2021-08-14 23:45:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-14 23:45:05 +0800 |
| commit | a19fc6d6da6627b5bdab702931ab6278e8cf8409 (patch) | |
| tree | 0c99d4e17fdaa16c7f64795dcc867aa285ce9700 /xmake/core/base/serialize.lua | |
| parent | 0795b09c48d770af91138edc417089830c1d4850 (diff) | |
sort table.keys
Diffstat (limited to 'xmake/core/base/serialize.lua')
| -rw-r--r-- | xmake/core/base/serialize.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/core/base/serialize.lua b/xmake/core/base/serialize.lua index 99486bf8c..a2d7b9ff9 100644 --- a/xmake/core/base/serialize.lua +++ b/xmake/core/base/serialize.lua @@ -123,7 +123,8 @@ function serialize._maketable(obj, opt, level, pathsegs, reftab) local sformat = opt.indentstr and "[%q] = %s" or "[%q]=%s" local nformat = opt.indentstr and "[%s] = %s" or "[%s]=%s" local keywords = serialize._keywords() - for k, v in pairs(serialized) do + local makepairs = opt.orderkeys and table.orderpairs or pairs + for k, v in makepairs(serialized) do local format -- serialize key if type(k) == "string" then |
