Skip to content

Commit

Permalink
No copy
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Feb 14, 2024
1 parent 6e8c156 commit fe56c42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ func getResult(respCh chan *pkg, timeoutCh chan bool) ([]byte, error) {
} else {
switch Proto(pkg.tp) {
case ProtoResData:
result = make([]byte, len(pkg.data))
copy(result, pkg.data)
result = pkg.data
pkg.data = nil
case ProtoResPong, ProtoResOk:
result = nil
case ProtoResError:
Expand Down

0 comments on commit fe56c42

Please sign in to comment.