summaryrefslogtreecommitdiff
path: root/Types/Key.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-16 18:38:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-16 18:50:13 -0400
commit2a4a641a3c940a652f62371f417433b47f7f3e79 (patch)
treee610e549f25dd4cd6719fcce9dcde14a69c46bd2 /Types/Key.hs
parente3da28295e11972bcb14749ef294d1f39fb03efa (diff)
use bloom filter in second pass of sync --all --content
This is needed because when preferred content matches on files, the second pass would otherwise want to drop all keys. Using a bloom filter avoids this, and in the case of a false positive, a key will be left undropped that preferred content would allow dropping. Chances of that happening are a mere 1 in 1 million.
Diffstat (limited to 'Types/Key.hs')
-rw-r--r--Types/Key.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Types/Key.hs b/Types/Key.hs
index 7f9f514c7..06adc4b91 100644
--- a/Types/Key.hs
+++ b/Types/Key.hs
@@ -132,8 +132,8 @@ instance Arbitrary Key where
<*> ((succ . abs <$>) <$> arbitrary) -- chunknum cannot be 0 or negative
instance Hashable Key where
- hashIO32 = hashIO32 . show
- hashIO64 = hashIO64 . show
+ hashIO32 = hashIO32 . key2file
+ hashIO64 = hashIO64 . key2file
prop_idempotent_key_encode :: Key -> Bool
prop_idempotent_key_encode k = Just k == (file2key . key2file) k