Software /
code /
prosody
Comparison
util/events.lua @ 6665:e923d7cb8430
Merge
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 06 May 2015 19:21:29 +0100 |
parent | 6664:5466f24e51c9 |
parent | 6648:999434eb1bbf |
child | 6777:5de6b93d0190 |
comparison
equal
deleted
inserted
replaced
6664:5466f24e51c9 | 6665:e923d7cb8430 |
---|---|
7 -- | 7 -- |
8 | 8 |
9 | 9 |
10 local pairs = pairs; | 10 local pairs = pairs; |
11 local t_insert = table.insert; | 11 local t_insert = table.insert; |
12 local t_remove = table.remove; | |
12 local t_sort = table.sort; | 13 local t_sort = table.sort; |
13 local setmetatable = setmetatable; | 14 local setmetatable = setmetatable; |
14 local next = next; | 15 local next = next; |
15 | 16 |
16 module "events" | 17 module "events" |
119 w = wrappers[event_name]; | 120 w = wrappers[event_name]; |
120 end | 121 end |
121 if not w then return; end | 122 if not w then return; end |
122 for i = #w, 1 do | 123 for i = #w, 1 do |
123 if w[i] == wrapper then | 124 if w[i] == wrapper then |
124 table.remove(w, i); | 125 t_remove(w, i); |
125 end | 126 end |
126 end | 127 end |
127 if #w == 0 then | 128 if #w == 0 then |
128 if event_name == nil then | 129 if event_name == nil then |
129 global_wrappers = nil; | 130 global_wrappers = nil; |