10,731
edits
TheNightAvl (talk | contribs) mNo edit summary |
TheNightAvl (talk | contribs) m (Optimisation) |
||
Line 196: | Line 196: | ||
local sorter_bor_proto = {} | local sorter_bor_proto = {} | ||
for key, _ in pairs(tab) do | for key, _ in pairs(tab) do | ||
local is_proto = mw.ustring.find(key, "%-pro[0-9]*$") | |||
local is_borrowed = mw.ustring.find(key, "%>[^%>%_%:]+$") | |||
if is_proto then | |||
if is_borrowed then table.insert(sorter_bor_proto, key) else table.insert(sorter_proto, key) end | |||
else | else | ||
if | if is_borrowed then table.insert(sorter_bor, key) else table.insert(sorter, key) end | ||
end | end | ||
end | end | ||
Line 220: | Line 214: | ||
for _, key in ipairs(sorter) do | for _, key in ipairs(sorter) do | ||
local out = " " .. items[key] | local out = " " .. items[key] | ||
for i = 1, it do | for i = 1, it do out = "*" .. out end -- this asterisk is for list formatting | ||
out = indenter .. out | out = indenter .. out | ||
table.insert(outs, out) | table.insert(outs, out) |