From f2da6581ba827a2aab091f764ace8017b26450d8 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 6 Jan 2017 16:44:20 +0100 Subject: all: fix issues reported by honnef.co/go/simple/cmd/gosimple --- swarm/storage/dbstore.go | 2 +- swarm/storage/types.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'swarm/storage') diff --git a/swarm/storage/dbstore.go b/swarm/storage/dbstore.go index 5ecc5c500..4ddebb021 100644 --- a/swarm/storage/dbstore.go +++ b/swarm/storage/dbstore.go @@ -354,7 +354,7 @@ func (s *DbStore) Get(key Key) (chunk *Chunk, err error) { hasher := s.hashfunc() hasher.Write(data) hash := hasher.Sum(nil) - if bytes.Compare(hash, key) != 0 { + if !bytes.Equal(hash, key) { s.db.Delete(getDataKey(index.Idx)) err = fmt.Errorf("invalid chunk. hash=%x, key=%v", hash, key[:]) return diff --git a/swarm/storage/types.go b/swarm/storage/types.go index 0dcbc0100..c36522012 100644 --- a/swarm/storage/types.go +++ b/swarm/storage/types.go @@ -41,7 +41,7 @@ func (x Key) Size() uint { } func (x Key) isEqual(y Key) bool { - return bytes.Compare(x, y) == 0 + return bytes.Equal(x, y) } func (h Key) bits(i, j uint) uint { -- cgit v1.2.3