mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-21 18:11:11 +00:00
parent
e2e571ca1f
commit
21a76d8c88
1 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Localize functions to avoid table lookups (better performance).
|
-- Localize functions to avoid table lookups (better performance).
|
||||||
local string_sub, string_find = string.sub, string.find
|
local string_sub, string_find, string_rep = string.sub, string.find, string.rep
|
||||||
local math = math
|
local math = math
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -179,7 +179,7 @@ function dump(value, indent)
|
||||||
write(newline)
|
write(newline)
|
||||||
|
|
||||||
local function write_entry(k, v)
|
local function write_entry(k, v)
|
||||||
write(indent:rep(level))
|
write(string_rep(indent, level))
|
||||||
write("[")
|
write("[")
|
||||||
write_value(k, level + 1)
|
write_value(k, level + 1)
|
||||||
write("] = ")
|
write("] = ")
|
||||||
|
@ -201,7 +201,7 @@ function dump(value, indent)
|
||||||
for _, k in ipairs(keys.string) do
|
for _, k in ipairs(keys.string) do
|
||||||
local v = val[k]
|
local v = val[k]
|
||||||
if is_valid_identifier(k) then
|
if is_valid_identifier(k) then
|
||||||
write(indent:rep(level))
|
write(string_rep(indent, level))
|
||||||
write(k)
|
write(k)
|
||||||
write(" = ")
|
write(" = ")
|
||||||
write_value(v, level + 1)
|
write_value(v, level + 1)
|
||||||
|
@ -219,7 +219,7 @@ function dump(value, indent)
|
||||||
end
|
end
|
||||||
if #keys.number == len then -- table is a list
|
if #keys.number == len then -- table is a list
|
||||||
for _, v in ipairs(tbl) do
|
for _, v in ipairs(tbl) do
|
||||||
write(indent:rep(level))
|
write(string_rep(indent, level))
|
||||||
write_value(v, level + 1)
|
write_value(v, level + 1)
|
||||||
write(",")
|
write(",")
|
||||||
write(newline)
|
write(newline)
|
||||||
|
@ -238,7 +238,7 @@ function dump(value, indent)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
write(indent:rep(level - 1))
|
write(string_rep(indent, level - 1))
|
||||||
write("}")
|
write("}")
|
||||||
end
|
end
|
||||||
write_value(value, 1)
|
write_value(value, 1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue