Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 04da989

Browse files
KommuSoftalexbiehl
authored andcommitted
simplify calculating percentages fixing #1194 (#1236)
1 parent d20dcc3 commit 04da989

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

haddock-api/src/Haddock/Interface.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do
186186
liftIO $ mapM_ putStrLn (nub msgs)
187187
dflags <- getDynFlags
188188
let (haddockable, haddocked) = ifaceHaddockCoverage interface
189-
percentage = round (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
189+
percentage = div (haddocked * 100) haddockable
190190
modString = moduleString (ifaceMod interface)
191191
coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
192192
header = case ifaceDoc interface of
@@ -245,4 +245,3 @@ buildHomeLinks ifaces = foldl upd Map.empty (reverse ifaces)
245245
mdl = ifaceMod iface
246246
keep_old env n = Map.insertWith (\_ old -> old) n mdl env
247247
keep_new env n = Map.insert n mdl env
248-

0 commit comments

Comments
 (0)