Revision | 4a5534fc807e07e5ffd314099ff90fce0b2f4566 (tree) |
---|---|
Zeit | 2024-03-30 11:38:10 |
Autor | Fs <Fsu0413@vip....> |
Commiter | Fs |
sort keys
@@ -1031,7 +1031,16 @@ end | ||
1031 | 1031 | |
1032 | 1032 | gen.dumpConfTable = function(self, para) |
1033 | 1033 | local returnText = "{\n" |
1034 | - for k, v in pairs(para) do | |
1034 | + local keys = {} | |
1035 | + | |
1036 | + for k in pairs(para) do | |
1037 | + table.insert(keys, k) | |
1038 | + end | |
1039 | + | |
1040 | + table.sort(keys) | |
1041 | + | |
1042 | + for _, k in ipairs(keys) do | |
1043 | + local v = para[k] | |
1035 | 1044 | -- key is always string |
1036 | 1045 | returnText = returnText .. "[\"" .. k .. "\"] = " |
1037 | 1046 | if type(v) == "nil" then |