Removed dupicate computation of values
This commit is contained in:
parent
b73b885c1e
commit
5f5b1dcb2b
|
@ -165,17 +165,22 @@ local function parse_files(paths, property_name, matcher, name_matcher)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
local insert_name = name:gsub("_", "_")
|
local insert_name = name:gsub("_", "_")
|
||||||
|
local link = get_link(file, var, var:match(exp3):gsub("_", "\\_"))
|
||||||
|
local desc = buffer:gmatch("[-*/ \n]+([^\n.]*)")() or ""
|
||||||
|
local mod = path_to_module(file)
|
||||||
|
|
||||||
if names[insert_name] == nil then
|
if names[insert_name] == nil then
|
||||||
count = count + 1
|
count = count + 1
|
||||||
table.insert(ret, count, {
|
table.insert(ret, count, {
|
||||||
file = file,
|
file = file,
|
||||||
name = insert_name,
|
name = insert_name,
|
||||||
link = get_link(file, var, var:match(exp3):gsub("_", "\\_")),
|
link = link,
|
||||||
desc = buffer:gmatch("[-*/ \n]+([^\n.]*)")() or "",
|
desc = desc,
|
||||||
mod = path_to_module(file)
|
mod = mod
|
||||||
})
|
})
|
||||||
names[insert_name] = count
|
names[insert_name] = count
|
||||||
else
|
else
|
||||||
|
link = link .. "(" .. mod .. ")"
|
||||||
if type(ret[names[insert_name]].link) ~= "table" then
|
if type(ret[names[insert_name]].link) ~= "table" then
|
||||||
ret[names[insert_name]].file = {
|
ret[names[insert_name]].file = {
|
||||||
ret[names[insert_name]].file,
|
ret[names[insert_name]].file,
|
||||||
|
@ -183,25 +188,21 @@ local function parse_files(paths, property_name, matcher, name_matcher)
|
||||||
}
|
}
|
||||||
ret[names[insert_name]].link = {
|
ret[names[insert_name]].link = {
|
||||||
ret[names[insert_name]].link .. " (" .. ret[names[insert_name]].mod .. ")",
|
ret[names[insert_name]].link .. " (" .. ret[names[insert_name]].mod .. ")",
|
||||||
get_link(file, var, var:match(exp3):gsub("_", "\\_")) .. " (" .. path_to_module(file) .. ")",
|
link
|
||||||
|
|
||||||
}
|
}
|
||||||
ret[names[insert_name]].desc = {
|
ret[names[insert_name]].desc = {
|
||||||
ret[names[insert_name]].desc,
|
ret[names[insert_name]].desc,
|
||||||
buffer:gmatch("[-*/ \n]+([^\n.]*)")() or ""
|
desc
|
||||||
}
|
}
|
||||||
ret[names[insert_name]].mod = {
|
ret[names[insert_name]].mod = {
|
||||||
ret[names[insert_name]].mod,
|
ret[names[insert_name]].mod,
|
||||||
path_to_module(file)
|
mod
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
table.insert(ret[names[insert_name]].file, file)
|
table.insert(ret[names[insert_name]].file, file)
|
||||||
table.insert(ret[names[insert_name]].link,
|
table.insert(ret[names[insert_name]].link, link)
|
||||||
get_link(file, var, var:match(exp3):gsub("_", "\\_")) .. " (" .. path_to_module(file) .. ")")
|
table.insert(ret[names[insert_name]].desc, desc)
|
||||||
table.insert(ret[names[insert_name]].desc,
|
table.insert(ret[names[insert_name]].mod, mod)
|
||||||
buffer:gmatch("[-*/ \n]+([^\n.]*)")() or "")
|
|
||||||
table.insert(ret[names[insert_name]].mod,
|
|
||||||
path_to_module(file))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue