Anonymous

Module:FunList: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 324: Line 324:
for _, item in pairs(self.mytable) do
for _, item in pairs(self.mytable) do
local key = keySelector(item)
local key = keySelector(item)
local value = item
local value = valueSelector and valueSelector(item) or item
if valueSelector then
value = valueSelector(item)  
end


if not lookup[key] then
if not lookup[key] then
Line 333: Line 330:
end
end


table.insert(lookup[key], item)
table.insert(lookup[key], value)
end
end
2,875

edits