summaryrefslogtreecommitdiffhomepage
path: root/ExpensiveHash.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-30 14:02:28 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-30 14:02:28 -0400
commit62a97cabd895001d4dc552823633aabe53d54358 (patch)
tree4ce54dbce4974f65efcc80aebd22d3148f10bfd4 /ExpensiveHash.hs
parent8e9d2029ad4d7c041a9c3ed0a1feebc60ebc4ea6 (diff)
downloadkeysafe-62a97cabd895001d4dc552823633aabe53d54358.tar.gz
fix calculation of usedcores
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 89a2f2b..8c473d3 100644
--- a/ExpensiveHash.hs
+++ b/ExpensiveHash.hs
@@ -64,7 +64,7 @@ benchmarkExpensiveHash rounds tunables@(UseArgon2 _ hashopts) expected = do
-- based on the number of cores, up to a maximum of the number
-- of threads that the hash is configred to use.
let maxthreads = Argon2.hashParallelism hashopts
- let usedcores = if numcores > maxthreads then maxthreads else numcores
+ let usedcores = min maxthreads numcores
let adjustedexpected = mapCost (`div` fromIntegral usedcores) expected
return $ BenchmarkResult
{ expectedBenchmark = adjustedexpected