Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary conversions #282

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ linters:
- nakedret
- revive
- prealloc
- unconvert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


linters-settings:
nakedret:
Expand Down
2 changes: 1 addition & 1 deletion datasquare.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func newDataSquare(data [][]byte, treeCreator TreeConstructorFn, chunkSize uint)
squareRow: squareRow,
squareCol: squareCol,
width: uint(width),
chunkSize: uint(chunkSize),
chunkSize: chunkSize,
createTreeFn: treeCreator,
}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions extendeddatasquare.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func ComputeExtendedDataSquare(
}

chunkSize := getChunkSize(data)
err := codec.ValidateChunkSize(int(chunkSize))
err := codec.ValidateChunkSize(chunkSize)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -86,7 +86,7 @@ func ImportExtendedDataSquare(
}

chunkSize := getChunkSize(data)
err := codec.ValidateChunkSize(int(chunkSize))
err := codec.ValidateChunkSize(chunkSize)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion extendeddatasquare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestNewExtendedDataSquare(t *testing.T) {
got, err := NewExtendedDataSquare(NewLeoRSCodec(), NewDefaultTree, edsWidth, shareSize)
assert.NoError(t, err)

chunk := bytes.Repeat([]byte{1}, int(incorrectChunkSize))
chunk := bytes.Repeat([]byte{1}, incorrectChunkSize)
err = got.SetCell(0, 0, chunk)
assert.Error(t, err)
})
Expand Down
Loading