2,875
edits
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 = | local value = valueSelector and valueSelector(item) or item | ||
if not lookup[key] then | if not lookup[key] then | ||
Line 333: | Line 330: | ||
end | end | ||
table.insert(lookup[key], | table.insert(lookup[key], value) | ||
end | end | ||
edits