File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ package pool
1111type Pool chan *Object
1212
1313func New (total int ) *Pool {
14- p := make (chan *Object , total)
14+ p := make (Pool , total)
1515
1616 for i := 0 ; i < total; i++ {
1717 p <- new (Object)
1818 }
1919
20- return p
20+ return & p
2121}
2222```
2323
@@ -34,7 +34,7 @@ case obj := <-p:
3434
3535 p <- obj
3636default :
37- // No more objects left retry later or fail
37+ // No more objects left — retry later or fail
3838 return
3939}
4040```
@@ -45,4 +45,4 @@ default:
4545 expensive than the object maintenance.
4646- If there are spikes in demand as opposed to a steady demand, the maintenance
4747 overhead might overweigh the benefits of an object pool.
48- - It has positive effects on performance due to object being initialized beforehand.
48+ - It has positive effects on performance due to objects being initialized beforehand.
You can’t perform that action at this time.
0 commit comments