mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 23:33:53 +01:00
Code quality
This commit is contained in:
parent
392959e50c
commit
e49cbdf9ff
12
luon.lua
12
luon.lua
@ -30,17 +30,17 @@ function write(value, write)
|
|||||||
end
|
end
|
||||||
local references = {}
|
local references = {}
|
||||||
local to_fill = {}
|
local to_fill = {}
|
||||||
for value, count in pairs(count_objects(value)) do
|
for object, count in pairs(count_objects(value)) do
|
||||||
local type_ = type(value)
|
local type_ = type(object)
|
||||||
if count >= 2 and (type_ ~= "string" or #reference + 2 >= #value) then
|
if count >= 2 and (type_ ~= "string" or #reference + 2 >= #object) then
|
||||||
local ref = table_concat(reference)
|
local ref = table_concat(reference)
|
||||||
write(ref)
|
write(ref)
|
||||||
write"="
|
write"="
|
||||||
write(type_ == "table" and "{}" or quote(value))
|
write(type_ == "table" and "{}" or quote(object))
|
||||||
write";"
|
write";"
|
||||||
references[value] = ref
|
references[object] = ref
|
||||||
if type_ == "table" then
|
if type_ == "table" then
|
||||||
to_fill[value] = true
|
to_fill[object] = true
|
||||||
end
|
end
|
||||||
increment_reference(1)
|
increment_reference(1)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user