improved some table usages

This commit is contained in:
Enrique García 2011-10-29 03:07:19 +02:00
parent 9dcf8055cf
commit 2a6aa41e55

View File

@ -15,8 +15,7 @@ local function copy(t)
return c
end
local function extractEventAndActionFromParams(...)
local params = {...}
local function extractEventAndActionFromParams(params)
local action = table.remove(params, #params)
return params, action
end
@ -75,7 +74,7 @@ function beholder:reset()
end
function beholder:observe(...)
local event, action = extractEventAndActionFromParams(...)
local event, action = extractEventAndActionFromParams({...})
return addActionToNode(self, findOrCreateNode(self, event), action)
end
@ -84,8 +83,7 @@ function beholder:stopObserving(id)
end
function beholder:trigger(...)
local event = {...}
return executeNodeActions(self, event)
return executeNodeActions(self, {...})
end
beholder:reset()