diff --git a/datasquare.go b/datasquare.go index 96fadb7..5c0a3cf 100644 --- a/datasquare.go +++ b/datasquare.go @@ -231,7 +231,7 @@ func (ds *dataSquare) getColRoot(y uint) []byte { return tree.Root() } -// getCell returns a single chunk at a specific cell. +// getCell returns a copy of single chunk at a specific cell. func (ds *dataSquare) getCell(x uint, y uint) []byte { if ds.squareRow[x][y] == nil { return nil diff --git a/extendeddatacrossword.go b/extendeddatacrossword.go index 8a97484..e9c9558 100644 --- a/extendeddatacrossword.go +++ b/extendeddatacrossword.go @@ -355,7 +355,7 @@ func (eds *ExtendedDataSquare) computeSharesRoot(shares [][]byte, i uint) []byte func (eds *ExtendedDataSquare) rowRangeNoMissingData(r, start, end uint) bool { for c := start; c <= end && c < eds.width; c++ { - if eds.getCell(r, c) == nil { + if eds.squareRow[r][c] == nil { return false } } @@ -364,7 +364,7 @@ func (eds *ExtendedDataSquare) rowRangeNoMissingData(r, start, end uint) bool { func (eds *ExtendedDataSquare) colRangeNoMissingData(c, start, end uint) bool { for r := start; r <= end && r < eds.width; r++ { - if eds.getCell(r, c) == nil { + if eds.squareRow[r][c] == nil { return false } }