File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ package pool
11
11
type Pool chan *Object
12
12
13
13
func New (total int ) *Pool {
14
- p := make (chan *Object , total)
14
+ p := make (Pool , total)
15
15
16
16
for i := 0 ; i < total; i++ {
17
17
p <- new (Object)
18
18
}
19
19
20
- return p
20
+ return & p
21
21
}
22
22
```
23
23
@@ -34,7 +34,7 @@ case obj := <-p:
34
34
35
35
p <- obj
36
36
default :
37
- // No more objects left retry later or fail
37
+ // No more objects left — retry later or fail
38
38
return
39
39
}
40
40
```
@@ -45,4 +45,4 @@ default:
45
45
expensive than the object maintenance.
46
46
- If there are spikes in demand as opposed to a steady demand, the maintenance
47
47
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