From 73b4eb6bf620c038aaac4b3f5cefa172ad8fb7fe Mon Sep 17 00:00:00 2001 From: kikito Date: Sat, 27 Oct 2012 18:45:25 +0200 Subject: [PATCH] code reordering --- cron.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cron.lua b/cron.lua index 1ededbe..2d70440 100644 --- a/cron.lua +++ b/cron.lua @@ -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()