Created
July 18, 2014 08:17
-
-
Save operator-DD3/8e3a7f82ea2bdf567141 to your computer and use it in GitHub Desktop.
Table Remove Duplicates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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