aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorJoerg T. (Mic92) <jthalheim@gmail.com>2011-08-18 19:43:09 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2011-08-18 20:39:22 +0200
commitf1844decefb931f5317fa9cadbaf65dfcdd7d829 (patch)
treed62c91bdc965878ede5bf000dbf3d6bfa02130a5 /init.lua
parentb11d251ef0326a67dee5e53efa8cd3543cea01e1 (diff)
downloadvicious-legacy-f1844decefb931f5317fa9cadbaf65dfcdd7d829.tar.xz
Allocate reg table with all values in one shot
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/init.lua b/init.lua
index a65adab..82316ed 100644
--- a/init.lua
+++ b/init.lua
@@ -141,20 +141,20 @@ end
-- {{{ Global functions
-- {{{ Register a widget
function register(widget, wtype, format, timer, warg)
- local reg = {}
local widget = widget
-
- -- Set properties
- reg.wtype = wtype
- reg.format = format
- reg.timer = timer
- reg.warg = warg
- reg.widget = widget
-
- -- Update function
- reg.update = function ()
- update(widget, reg)
- end
+ local reg = {
+ -- Set properties
+ wtype = wtype,
+ format = format,
+ timer = timer,
+ warg = warg,
+ widget = widget,
+
+ -- Update function
+ update = function ()
+ update(widget, reg)
+ end,
+ }
-- Default to 2s timer
if reg.timer == nil then