use bytes.Equal rather than bytes.Compare

master
Harshavardhana 2016-04-29 14:00:48 -07:00
parent 55f0000302
commit 0b630aea27
2 changed files with 2 additions and 5 deletions

View File

@ -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

View File

@ -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()