code reordering

This commit is contained in:
kikito 2012-10-27 18:45:25 +02:00
parent 8dd3dae68b
commit 73b4eb6bf6

View File

@ -10,6 +10,11 @@
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- Private functions
local entries = {}
local function isCallable(callback)
local tc = type(callback)
if tc == 'function' then return true end
@ -25,8 +30,6 @@ local function checkTimeAndCallback(time, callback)
assert(isCallable(callback), "callback must be a function")
end
local entries = {}
local function newEntry(time, callback, update, ...)
local entry = {
time = time,
@ -56,6 +59,8 @@ local function updatePeriodicEntry(self, dt)
end
end
-- Public functions
local cron = {}
function cron.reset()