summaryrefslogtreecommitdiffhomepage
path: root/ExpensiveHash.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-30 13:53:18 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-30 13:53:18 -0400
commit3ccd6fe4c21d333d4798da519fe3c7bf83a5c99f (patch)
treef4b8160d6fd1f898a9085270bd67c382adefa38e /ExpensiveHash.hs
parentfb2f7b13b9035cbb3312678b4a8d7d883db64b9b (diff)
downloadkeysafe-3ccd6fe4c21d333d4798da519fe3c7bf83a5c99f.tar.gz
fence post
Diffstat (limited to 'ExpensiveHash.hs')
-rw-r--r--ExpensiveHash.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ExpensiveHash.hs b/ExpensiveHash.hs
index 5799d83..6d1e6c8 100644
--- a/ExpensiveHash.hs
+++ b/ExpensiveHash.hs
@@ -77,7 +77,7 @@ getNumCores :: IO Integer
getNumCores = getmax . mapMaybe parse . lines <$> readFile "/proc/cpuinfo"
where
getmax [] = error "Unknown number of physical cores."
- getmax l = maximum l
+ getmax l = maximum l + 1 -- add 1 because /proc/cpuinfo counts from 0
parse l
| "core id" `isPrefixOf` l = readMaybe $ dropWhile (/= ':') l
| otherwise = Nothing