Assuming I want to save guids. At some point in the future I want to remove outdated guids.
Lua Code:
local guids = {}
local guidA = "12345"
local guidB = "ABCDE"
guids[guidA] = { time=time(), hp=UnitHealth(guidA) }
guids[guidB] = { time=time(), hp=UnitHealth(guidB) }
*edit* Just found what I was looking for in the last sentence.
So I guess I will do this
Lua Code:
for k,v in ipairs(guids) do
if time()-3600 > v.time then
guids[k] = nil
end
end
Question. If I set the table value for a key to nil. When ipairs is called again. Will ipairs return keys with a value of nil?