all: fix issues reported by honnef.co/go/simple/cmd/gosimple
This commit is contained in:
@ -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
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user