Comparison

util/timer.lua @ 6054:7a5ddbaf758d

Merge 0.9->0.10
author Matthew Wild <mwild1@gmail.com>
date Wed, 02 Apr 2014 17:41:38 +0100
parent 5776:bd0ff8ae98a8
child 5877:615a0774e4cc
child 6777:5de6b93d0190
comparison
equal deleted inserted replaced
6053:2f93a04564b2 6054:7a5ddbaf758d
1 -- Prosody IM 1 -- Prosody IM
2 -- Copyright (C) 2008-2010 Matthew Wild 2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2010 Waqas Hussain 3 -- Copyright (C) 2008-2010 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local server = require "net.server"; 9 local server = require "net.server";
40 for _, d in pairs(new_data) do 40 for _, d in pairs(new_data) do
41 t_insert(data, d); 41 t_insert(data, d);
42 end 42 end
43 new_data = {}; 43 new_data = {};
44 end 44 end
45 45
46 local next_time = math_huge; 46 local next_time = math_huge;
47 for i, d in pairs(data) do 47 for i, d in pairs(data) do
48 local t, callback = d[1], d[2]; 48 local t, callback = d[1], d[2];
49 if t <= current_time then 49 if t <= current_time then
50 data[i] = nil; 50 data[i] = nil;