lib: stop using unpack where not needed

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-05-25 11:14:08 +02:00
parent 40710e43ba
commit b546328ae9
7 changed files with 10 additions and 17 deletions

View File

@ -7,7 +7,6 @@
-- Grab environment we need
local setmetatable = setmetatable
local ipairs = ipairs
local unpack = unpack
local capi = { button = button }
local util = require("awful.util")
@ -31,11 +30,11 @@ function new(mod, ...)
local ret = {}
local subsets = util.subsets(ignore_modifiers)
for _, set in ipairs(subsets) do
ret[#ret + 1] = capi.button(util.table.join(mod, set), unpack(arg))
ret[#ret + 1] = capi.button(util.table.join(mod, set), ...)
end
return ret
end
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function(_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -7,7 +7,6 @@
-- Grab environment we need
local setmetatable = setmetatable
local ipairs = ipairs
local unpack = unpack
local capi = { key = key }
local util = require("awful.util")
@ -31,7 +30,7 @@ function new(mod, ...)
local ret = {}
local subsets = util.subsets(ignore_modifiers)
for _, set in ipairs(subsets) do
ret[#ret + 1] = capi.key(util.table.join(mod, set), unpack(arg))
ret[#ret + 1] = capi.key(util.table.join(mod, set), ...)
end
return ret
end
@ -62,6 +61,6 @@ function match(key, pressed_mod, pressed_key)
return true
end
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function(_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -5,7 +5,6 @@
---------------------------------------------------------------------------
local setmetatable = setmetatable
local unpack = unpack
local type = type
local button = require("awful.button")
local capi = { image = image,
@ -39,6 +38,6 @@ function new(args)
return w
end
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function(_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -5,7 +5,6 @@
---------------------------------------------------------------------------
local setmetatable = setmetatable
local unpack = unpack
local util = require("awful.util")
local wbutton = require("awful.widget.button")
local button = require("awful.button")
@ -31,6 +30,6 @@ function new(args)
return w
end
setmetatable(_M, { __call = function (_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function (_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -5,7 +5,6 @@
---------------------------------------------------------------------------
local setmetatable = setmetatable
local unpack = unpack
local capi = { widget = widget }
local completion = require("awful.completion")
@ -19,7 +18,7 @@ module("awful.widget.prompt")
local function run(promptbox)
return prompt.run({ prompt = promptbox.prompt },
promptbox.widget,
function (...) promptbox.widget.text = util.spawn(unpack(arg)) end,
function (...) promptbox.widget.text = util.spawn(...) end,
completion.shell,
util.getdir("cache") .. "/history")
end
@ -38,6 +37,6 @@ function new(args)
return promptbox
end
setmetatable(_M, { __call = function (_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function (_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -11,7 +11,6 @@ local capi = { widget = widget,
client = client }
local type = type
local setmetatable = setmetatable
local unpack = unpack
local pairs = pairs
local ipairs = ipairs
local hooks = require("awful.hooks")
@ -176,6 +175,6 @@ function label.noempty(t, args)
end
end
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function(_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -11,7 +11,6 @@ local capi = { screen = screen,
local ipairs = ipairs
local type = type
local setmetatable = setmetatable
local unpack = unpack
local table = table
local hooks = require("awful.hooks")
local common = require("awful.widget.common")
@ -188,6 +187,6 @@ function label.currenttags(c, screen, args)
end
end
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
setmetatable(_M, { __call = function(_, ...) return new(...) end })
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80