1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Don't write hashes for empty ranges

This commit is contained in:
mcrakhman 2023-12-01 22:42:52 +01:00
parent a24e91aecd
commit 51f44b8032
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -216,6 +216,8 @@ func (h *hashRanges) calcElementsHash(from, to uint64) (hash []byte, els int) {
hasher.WriteString(elem.Head) hasher.WriteString(elem.Head)
els++ els++
} }
hash = hasher.Sum(nil) if els != 0 {
hash = hasher.Sum(nil)
}
return return
} }