table.foreach deprecated in lua 5.1

This commit is contained in:
Glenn Maynard
2006-09-21 03:04:28 +00:00
parent 8b8d2af09f
commit d293c0a09a
2 changed files with 8 additions and 6 deletions
@@ -75,7 +75,10 @@ function DeepCopy(t, already_copied)
already_copied[t] = { }
local ret = already_copied[t]
table.foreach(t, function(a,b) ret[a] = DeepCopy(b, already_copied) end)
for a, b in pairs(t) do
ret[a] = DeepCopy( b, already_copied )
end
return ret
end