Skip to content

1.11.0: gorush: do less copying in queueNotification (#370)

Compare
Choose a tag to compare
@appleboy appleboy released this 17 Sep 07:59
· 447 commits to master since this release
The PushNotification object is quite big (772 bytes on AMD64),
so avoid doing too many copying without a need.

Collect pointers and do copying only when sending into a channel.

Found using https://go-critic.github.io/overview#rangeValCopy-ref

Linter output:
```
$GOPATH/src/github.com/appleboy/gorush/gorush/worker.go:38:2: rangeValCopy: each iteration copies 772 bytes (consider pointers or indexing)
$GOPATH/src/github.com/appleboy/gorush/gorush/worker.go:53:2: rangeValCopy: each iteration copies 772 bytes (consider pointers or indexing)
```