Skip to content

Commit

Permalink
perf: use slice to improve efficiency (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed May 14, 2023
1 parent 246b981 commit cf68837
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func relayHelper(c *gin.Context) error {
select {
case data := <-dataChan:
if strings.HasPrefix(data, "data: [DONE]") {
data = "data: [DONE]"
data = data[:12]
}
c.Render(-1, common.CustomEvent{Data: data})
return true
Expand Down

0 comments on commit cf68837

Please sign in to comment.