Skip to content

Commit

Permalink
grace: fix empty copyOut (#97)
Browse files Browse the repository at this point in the history
* fix: remove empty copyOut

* reserve capacity for copyOut

---------

Co-authored-by: Yang Gao <6821729+criyle@users.noreply.github.com>
  • Loading branch information
BoYanZh and criyle authored Mar 4, 2024
1 parent 01863bc commit b0c85a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/go-judge-shell/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func convertPBCopyIn(copyIn map[string]model.CmdFile) map[string]*pb.Request_Fil
}

func convertPBCopyOut(copyOut []string) []*pb.Request_CmdCopyOutFile {
rt := make([]*pb.Request_CmdCopyOutFile, len(copyOut))
rt := make([]*pb.Request_CmdCopyOutFile, 0, len(copyOut))
for _, n := range copyOut {
optional := false
if strings.HasSuffix(n, "?") {
Expand Down

0 comments on commit b0c85a6

Please sign in to comment.