# HG changeset patch # User Matthew Wild # Date 1337438149 -3600 # Node ID 36df30395c44dc501c6974f1728bc81e2b1e00f3 # Parent c874dc4ccbd7e3dc8b8fc43a5194566ebea85800 util.multitable: No longer use table.remove to drop elements from the stack, when key is nil immediately (on empty tables) the previous stack entry's key gets removed instead diff -r c874dc4ccbd7 -r 36df30395c44 util/multitable.lua --- a/util/multitable.lua Sat May 19 04:12:41 2012 +0100 +++ b/util/multitable.lua Sat May 19 15:35:49 2012 +0100 @@ -7,7 +7,7 @@ -- local select = select; -local t_insert, t_remove = table.insert, table.remove; +local t_insert = table.insert; local unpack, pairs, next, type = unpack, pairs, next, type; module "multitable" @@ -135,8 +135,7 @@ local depth = #stack; local key = next(stack[depth], keys[depth]); if key == nil then -- Go up the stack - t_remove(stack); - t_remove(keys); + stack[depth], keys[depth] = nil, nil; if depth > 1 then return it(self); end