use bytes.Equal rather than bytes.Compare
parent
55f0000302
commit
0b630aea27
|
@ -178,10 +178,7 @@ func (m matrix) SwapRows(r1, r2 int) error {
|
|||
// IsSquare will return true if the matrix is square
|
||||
// and nil if the matrix is square
|
||||
func (m matrix) IsSquare() bool {
|
||||
if len(m) != len(m[0]) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return len(m) == len(m[0])
|
||||
}
|
||||
|
||||
// errSingular is returned if the matrix is singular and cannot be inversed
|
||||
|
|
|
@ -280,7 +280,7 @@ func (r reedSolomon) checkSomeShards(matrixRows, inputs, toCheck [][]byte, outpu
|
|||
}
|
||||
|
||||
for i, calc := range outputs {
|
||||
if bytes.Compare(calc, toCheck[i][start:start+do]) != 0 {
|
||||
if !bytes.Equal(calc, toCheck[i][start:start+do]) {
|
||||
mu.Lock()
|
||||
same = false
|
||||
mu.Unlock()
|
||||
|
|
Loading…
Reference in New Issue