summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Cpu.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/Monitors/Cpu.hs')
-rw-r--r--src/Plugins/Monitors/Cpu.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Plugins/Monitors/Cpu.hs b/src/Plugins/Monitors/Cpu.hs
index df2dc4e..10d945f 100644
--- a/src/Plugins/Monitors/Cpu.hs
+++ b/src/Plugins/Monitors/Cpu.hs
@@ -38,8 +38,8 @@ parseCpu cref =
b <- cpuData
writeIORef cref b
let dif = zipWith (-) b a
- tot = fromIntegral $ foldr (+) 0 dif
- percent = map (/ tot) (map fromIntegral dif)
+ tot = fromIntegral $ sum dif
+ percent = map ((/ tot) . fromIntegral) dif
return percent
formatCpu :: [Float] -> Monitor [String]