lib: stop using unpack where not needed
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
40710e43ba
commit
b546328ae9
|
@ -7,7 +7,6 @@
|
||||||
-- Grab environment we need
|
-- Grab environment we need
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local unpack = unpack
|
|
||||||
local capi = { button = button }
|
local capi = { button = button }
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
|
|
||||||
|
@ -31,11 +30,11 @@ function new(mod, ...)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
local subsets = util.subsets(ignore_modifiers)
|
local subsets = util.subsets(ignore_modifiers)
|
||||||
for _, set in ipairs(subsets) do
|
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
|
end
|
||||||
return ret
|
return ret
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
-- Grab environment we need
|
-- Grab environment we need
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local unpack = unpack
|
|
||||||
local capi = { key = key }
|
local capi = { key = key }
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ function new(mod, ...)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
local subsets = util.subsets(ignore_modifiers)
|
local subsets = util.subsets(ignore_modifiers)
|
||||||
for _, set in ipairs(subsets) do
|
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
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
@ -62,6 +61,6 @@ function match(key, pressed_mod, pressed_key)
|
||||||
return true
|
return true
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local unpack = unpack
|
|
||||||
local type = type
|
local type = type
|
||||||
local button = require("awful.button")
|
local button = require("awful.button")
|
||||||
local capi = { image = image,
|
local capi = { image = image,
|
||||||
|
@ -39,6 +38,6 @@ function new(args)
|
||||||
return w
|
return w
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local unpack = unpack
|
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
local wbutton = require("awful.widget.button")
|
local wbutton = require("awful.widget.button")
|
||||||
local button = require("awful.button")
|
local button = require("awful.button")
|
||||||
|
@ -31,6 +30,6 @@ function new(args)
|
||||||
return w
|
return w
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local unpack = unpack
|
|
||||||
|
|
||||||
local capi = { widget = widget }
|
local capi = { widget = widget }
|
||||||
local completion = require("awful.completion")
|
local completion = require("awful.completion")
|
||||||
|
@ -19,7 +18,7 @@ module("awful.widget.prompt")
|
||||||
local function run(promptbox)
|
local function run(promptbox)
|
||||||
return prompt.run({ prompt = promptbox.prompt },
|
return prompt.run({ prompt = promptbox.prompt },
|
||||||
promptbox.widget,
|
promptbox.widget,
|
||||||
function (...) promptbox.widget.text = util.spawn(unpack(arg)) end,
|
function (...) promptbox.widget.text = util.spawn(...) end,
|
||||||
completion.shell,
|
completion.shell,
|
||||||
util.getdir("cache") .. "/history")
|
util.getdir("cache") .. "/history")
|
||||||
end
|
end
|
||||||
|
@ -38,6 +37,6 @@ function new(args)
|
||||||
return promptbox
|
return promptbox
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -11,7 +11,6 @@ local capi = { widget = widget,
|
||||||
client = client }
|
client = client }
|
||||||
local type = type
|
local type = type
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local unpack = unpack
|
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local hooks = require("awful.hooks")
|
local hooks = require("awful.hooks")
|
||||||
|
@ -176,6 +175,6 @@ function label.noempty(t, args)
|
||||||
end
|
end
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -11,7 +11,6 @@ local capi = { screen = screen,
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local type = type
|
local type = type
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
local unpack = unpack
|
|
||||||
local table = table
|
local table = table
|
||||||
local hooks = require("awful.hooks")
|
local hooks = require("awful.hooks")
|
||||||
local common = require("awful.widget.common")
|
local common = require("awful.widget.common")
|
||||||
|
@ -188,6 +187,6 @@ function label.currenttags(c, screen, args)
|
||||||
end
|
end
|
||||||
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
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue