diff options
author | Geoff Leyland <geoff_leyland@fastmail.fm> | 2009-11-06 12:49:00 -0300 |
---|---|---|
committer | Norman Clarke <norman@njclarke.com> | 2009-11-06 12:49:00 -0300 |
commit | bcc9d9b6435dfc1c90e87c1d0c64ceb9d3a6239e (patch) | |
tree | 5678a6c7494030a1a319007624c5c1200db92bd6 | |
parent | 470f9e34dc7f833cc23496602da90903d4a0f5fe (diff) | |
download | luacov-bcc9d9b6435dfc1c90e87c1d0c64ceb9d3a6239e.tar.gz |
Adds most_hits to gathered statistics.
Signed-off-by: Norman Clarke <norman@njclarke.com>
-rw-r--r-- | src/luacov/stats.lua | 5 |
1 files 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() |