Skip to content

Commit

Permalink
Added Remove function to tables created by NewTable.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldevahl committed Jan 7, 2012
1 parent c52aa7e commit 87e4f2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/base.lua
Expand Up @@ -467,6 +467,16 @@ function NewTable()
end
self.version = self.version + 1
end

t.Remove = function(self, val)
local tmp = {}
for k,v in ipairs(self) do
if v == val then
table.remove(self, k)
end
end
self.version = self.version + 1
end

t.version = 0

Expand Down

0 comments on commit 87e4f2e

Please sign in to comment.