util/deephash: fix map hashing to actually hash elements

Fixes #4868

Change-Id: I574fd139cb7f7033dd93527344e6aa0e625477c7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2022-06-16 11:24:04 -07:00
committed by Brad Fitzpatrick
parent 4005134263
commit 36ea837736
2 changed files with 10 additions and 1 deletions

View File

@ -342,7 +342,7 @@ func (h *hasher) hashMap(v reflect.Value) {
e.SetIterValue(iter)
mh.h.reset()
mh.h.hashValue(k)
mh.h.hashValue(v)
mh.h.hashValue(e)
sum.xor(mh.h.sum())
}
h.bw.Write(append(h.scratch[:0], sum.sum[:]...)) // append into scratch to avoid heap allocation