Skip to content

Commit

Permalink
Merge pull request #88 from celestiaorg/no-copy-getCell
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan authored May 16, 2022
2 parents 5dc63b1 + 35aa186 commit 80b016d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion datasquare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions extendeddatacrossword.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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
}
}
Expand Down

0 comments on commit 80b016d

Please sign in to comment.