Skip to content

Commit

Permalink
chore: use deepCopy (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Jun 23, 2023
1 parent 21ac9ac commit 36829ac
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions extendeddatasquare.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,7 @@ func (eds *ExtendedDataSquare) deepCopy(codec Codec) (ExtendedDataSquare, error)
// Col returns a column slice.
// This slice is a copy of the internal column slice.
func (eds *ExtendedDataSquare) Col(y uint) [][]byte {
col := make([][]byte, eds.width)
original := eds.col(y)
for i, cell := range original {
col[i] = make([]byte, eds.chunkSize)
copy(col[i], cell)
}
return col
return deepCopy(eds.col(y))
}

// ColRoots returns the Merkle roots of all the columns in the square.
Expand Down

0 comments on commit 36829ac

Please sign in to comment.