Skip to content

Commit

Permalink
bugfix: all outstanding issues identified by deepsource (#22)
Browse files Browse the repository at this point in the history
* fix: remove outdated skipcq comments

Signed-off-by: Gaukas Wang <i@gaukas.wang>

* fix: combine append call for performance

Signed-off-by: Gaukas Wang <i@gaukas.wang>

* fix: ignore high cyclomatic complexity warning

Signed-off-by: Gaukas Wang <i@gaukas.wang>

---------

Signed-off-by: Gaukas Wang <i@gaukas.wang>
  • Loading branch information
gaukas committed Jun 3, 2024
1 parent 05070a8 commit 3f06ffa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/utils/typeconv.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package utils
func Uint16ToUint8(a []uint16) []uint8 {
b := make([]uint8, 0)
for _, v := range a {
b = append(b, uint8(v>>8))
b = append(b, uint8(v))
b = append(b, uint8(v>>8), uint8(v))
}
return b
}
2 changes: 0 additions & 2 deletions quic_client_initial.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"time"
)

// skipcq: GSC-G505

type ClientInitial struct {
Header *QUICHeader `json:"header,omitempty"` // QUIC header
FrameTypes []uint64 `json:"frames,omitempty"` // frames ID in order
Expand Down
2 changes: 1 addition & 1 deletion quic_transport_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type QUICTransportParameters struct {
// TLS Extension "QUIC Transport Parameters" (57)
//
// If any error occurs, the returned struct will have parseError set to the error.
func ParseQUICTransportParameters(extData []byte) *QUICTransportParameters {
func ParseQUICTransportParameters(extData []byte) *QUICTransportParameters { // skipcq: GO-R1005
qtp := &QUICTransportParameters{
parseError: errors.New("unknown error"),
}
Expand Down

0 comments on commit 3f06ffa

Please sign in to comment.