Commit Graph
3 Commits
Author SHA1 Message Date
Iskander (Alex) Sharipov d275ddbccb gorush: do less copying in queueNotification (#370)
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)
```
2018-09-17 14:55:23 +08:00
Iskander (Alex) Sharipov 313544bde6 remove unnecessary wrapping lambda, use function value directly (#372)
Found using https://go-critic.github.io/overview#unlambda-ref
2018-09-14 08:50:11 +08:00
Iskander (Alex) Sharipov 82c3ceb70d remove dead code after log.Fatal call (#371)
Found using https://go-critic.github.io/overview#deadCodeAfterLogFatal-ref
2018-09-14 08:42:43 +08:00