Modify hash for HashSet to use xor to mix hash of items.

This commit is contained in:
Lolo Iccl 2018-05-08 22:09:37 +09:00 • committed by Andreas Rumpf
commit af591544c5
2 changed files with 2 additions and 9 deletions

View file

@ -85,10 +85,6 @@ block hashForHashedSet:
var hashSeq: seq[Hash] = @[]
doAssert s1 == s2
doAssert hash(s1) == hash(s2)
for c in seq1:
if (not (hash(c) in hashSeq)):
hashSeq.add(hash(c))
doAssert hash(s1) == hash(sorted(hashSeq, cmp[Hash]))
block hashForOrderdSet:
let