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 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. -- 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 function isCallable(callback)
local tc = type(callback) local tc = type(callback)
if tc == 'function' then return true end if tc == 'function' then return true end
@ -25,8 +30,6 @@ local function checkTimeAndCallback(time, callback)
assert(isCallable(callback), "callback must be a function") assert(isCallable(callback), "callback must be a function")
end end
local entries = {}
local function newEntry(time, callback, update, ...) local function newEntry(time, callback, update, ...)
local entry = { local entry = {
time = time, time = time,
@ -56,6 +59,8 @@ local function updatePeriodicEntry(self, dt)
end end
end end
-- Public functions
local cron = {} local cron = {}
function cron.reset() function cron.reset()