From d985aa9e4bd696535217c0672cc182de839b049c Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Sun, 21 Jun 2020 20:23:06 +0200 Subject: [PATCH] lib/scanner: Fix Validate docs (#6776) Co-authored-by: greatroar <@> --- lib/scanner/blocks.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scanner/blocks.go b/lib/scanner/blocks.go index 6e2cc6743..55a57d236 100644 --- a/lib/scanner/blocks.go +++ b/lib/scanner/blocks.go @@ -108,9 +108,9 @@ func Blocks(ctx context.Context, r io.Reader, blocksize int, sizehint int64, cou return blocks, nil } -// Validate quickly validates buf against the cryptohash hash (if len(hash)>0) -// and the 32-bit hash weakHash (if not zero). It is satisfied if either hash -// matches, or neither is given. +// Validate quickly validates buf against the 32-bit weakHash, if not zero, +// else against the cryptohash hash, if len(hash)>0. +// It is satisfied if neither hash is given. func Validate(buf, hash []byte, weakHash uint32) bool { if weakHash != 0 { return adler32.Checksum(buf) == weakHash