Comparison

util/filters.lua @ 4015:a35fa3368626

util.filters: Add remove_filter_hook()
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Dec 2010 16:46:19 +0000
parent 3625:f8d61da5bcc1
child 5776:bd0ff8ae98a8
child 5849:8f451d370dd4
comparison
equal deleted inserted replaced
4014:5711c8755b96 4015:a35fa3368626
74 74
75 function add_filter_hook(callback) 75 function add_filter_hook(callback)
76 t_insert(new_filter_hooks, callback); 76 t_insert(new_filter_hooks, callback);
77 end 77 end
78 78
79 function remove_filter_hook(callback)
80 for i=1,#new_filter_hooks do
81 if new_filter_hooks[i] == callback then
82 t_remove(new_filter_hooks, i);
83 end
84 end
85 end
86
79 return _M; 87 return _M;