Skip to content

Commit a523c5f

Browse files
leonklingeletmrts
authored andcommitted
creational/object-pool: fix typos
1 parent af1dfcd commit a523c5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

creational/object-pool.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ package pool
1111
type Pool chan *Object
1212

1313
func 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
3636
default:
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.

0 commit comments

Comments
 (0)