From 2a6aa41e554886d5275282252ea54607a7dcfa1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Garc=C3=ADa?= Date: Sat, 29 Oct 2011 03:07:19 +0200 Subject: [PATCH] improved some table usages --- beholder.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/beholder.lua b/beholder.lua index e364716..8e4dcb0 100644 --- a/beholder.lua +++ b/beholder.lua @@ -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()