awful.client: do not use otable()

We use a weak-keyed-table, that's enought and quicker.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-04-11 14:01:30 +02:00
parent a4a745d505
commit e4ab810154
1 changed files with 2 additions and 11 deletions

View File

@ -11,7 +11,6 @@ local pairs = pairs
local ipairs = ipairs local ipairs = ipairs
local table = table local table = table
local math = math local math = math
local otable = require("otable")
local setmetatable = setmetatable local setmetatable = setmetatable
local capi = local capi =
{ {
@ -26,11 +25,11 @@ local hooks = require("awful.hooks")
module("awful.client") module("awful.client")
-- Private data -- Private data
local data = {} data = {}
data.focus = {} data.focus = {}
data.urgent = {} data.urgent = {}
data.marked = {} data.marked = {}
data.properties = otable() data.properties = setmetatable({}, { __mode = 'k' })
-- Functions -- Functions
urgent = {} urgent = {}
@ -819,13 +818,6 @@ function property.set(c, prop, value)
data.properties[c][prop] = value data.properties[c][prop] = value
end end
-- Kill client property.
-- This is garbage collection done on unmanage.
-- @param c The client.
local function killproperty(c)
data.properties[c] = nil
end
-- Register standards hooks -- Register standards hooks
hooks.focus.register(focus.history.add) hooks.focus.register(focus.history.add)
hooks.unmanage.register(focus.history.delete) hooks.unmanage.register(focus.history.delete)
@ -835,6 +827,5 @@ hooks.focus.register(urgent.delete)
hooks.unmanage.register(urgent.delete) hooks.unmanage.register(urgent.delete)
hooks.unmanage.register(floating.delete) hooks.unmanage.register(floating.delete)
hooks.unmanage.register(killproperty)
-- 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