From bcc9d9b6435dfc1c90e87c1d0c64ceb9d3a6239e Mon Sep 17 00:00:00 2001 From: Geoff Leyland Date: Fri, 6 Nov 2009 12:49:00 -0300 Subject: Adds most_hits to gathered statistics. Signed-off-by: Norman Clarke --- src/luacov/stats.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/luacov/stats.lua b/src/luacov/stats.lua index fbf1b6a..3fa5916 100644 --- a/src/luacov/stats.lua +++ b/src/luacov/stats.lua @@ -4,7 +4,7 @@ module("luacov.stats", package.seeall) local statsfile = "luacov.stats.out" function load_stats() - local data = {} + local data, most_hits = {}, 0 local stats = io.open(statsfile, "r") if not stats then return data end while true do @@ -23,11 +23,12 @@ function load_stats() if skip ~= " " then break end if hits > 0 then data[filename][i] = hits + most_hits = math.max(most_hits, hits) end end end stats:close() - return data + return data, most_hits end function start_stats() -- cgit v1.2.1