forked from enlightenment/efl
elua: new util: table.uniq, and use it in xgettext generator
This commit is contained in:
parent
aab605e36a
commit
d0ff647776
|
@ -366,4 +366,17 @@ M.find_file = function(fname, paths)
|
|||
end
|
||||
end
|
||||
|
||||
-- table utils
|
||||
|
||||
table.uniq = function(tbl)
|
||||
local ret = {}
|
||||
local used = {}
|
||||
for i, v in ipairs(tbl) do
|
||||
if not used[v] then
|
||||
ret[#ret + 1], used[v] = v, true
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
return M
|
|
@ -69,6 +69,9 @@ local gen_grouped_messages = function(ps)
|
|||
end
|
||||
msg = ps()
|
||||
end
|
||||
for i, msg in ipairs(ret) do
|
||||
msg.flags = table.uniq(msg.flags)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue