Skip to content

Instantly share code, notes, and snippets.

@operator-DD3
Created July 18, 2014 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save operator-DD3/8e3a7f82ea2bdf567141 to your computer and use it in GitHub Desktop.
Save operator-DD3/8e3a7f82ea2bdf567141 to your computer and use it in GitHub Desktop.
Table Remove Duplicates
local test = {1,2,4,2,3,4,2,3,4,"A", "B", "A"}
local hash = {}
local res = {}
for _,v in ipairs(test) do
if (not hash[v]) then
res[#res+1] = v
hash[v] = true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment