From 2b1e3248b268a9caff08473860aeb37b70462007 Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Wed, 21 Apr 2010 00:32:02 +0200 Subject: [PATCH] move timestamp function to the top of the data module so that it can be made private --- openwrt/package/flukso/src/data.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/openwrt/package/flukso/src/data.lua b/openwrt/package/flukso/src/data.lua index be20c3f..ef062fa 100644 --- a/openwrt/package/flukso/src/data.lua +++ b/openwrt/package/flukso/src/data.lua @@ -29,6 +29,14 @@ local getfenv, setmetatable, pairs, ipairs = module (...) local modenv = getfenv() -- module environment +-- private +local function timestamps(T) + local H = {} -- helper table, an indexed array containing all the measurement's timestamps + for timestamp in pairs(T) do H[#H+1] = timestamp end + table.sort(H) -- sort in ascending order, oldest timestamps will be treated first + return H +end + function new() return setmetatable({}, {__index = modenv}) end @@ -89,10 +97,3 @@ function json_encode(M) end return J end - -function timestamps(T) - local H = {} -- helper table, an indexed array containing all the measurement's timestamps - for timestamp in pairs(T) do H[#H+1] = timestamp end - table.sort(H) -- sort in ascending order, oldest timestamps will be treated first - return H -end