]> git.maquefel.me Git - brevno-suite/hugo/commit
metrics: Fix divide by zero error
authorCameron Moore <moorereason@gmail.com>
Thu, 26 May 2022 02:14:37 +0000 (21:14 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 26 May 2022 08:39:29 +0000 (10:39 +0200)
commit6a5acd753abbd899547c89b369de71df639cce19
tree2aca1bc7d9ea86129819db0f248fe83c95f9cd12
parent805b21555e283c28a669943a36af6d6d699e9198
metrics: Fix divide by zero error

Under certain conditions, `howSimilarString` could reach a divide-by-
zero situation which causes bogus values to print in the cache potential
column of the template hints output.  This situation essentially causes
a `int(math.NaN())` value to be returned and hilarity ensues thereafter.
metrics/metrics.go
metrics/metrics_test.go