mirror of https://github.com/panjf2000/ants.git
Merge pull request #14 from SimePel/master
Remove meaningless if statements
This commit is contained in:
commit
29730bb703
2
pool.go
2
pool.go
|
@ -146,11 +146,9 @@ func (p *Pool) ReSize(size int) {
|
||||||
}
|
}
|
||||||
atomic.StoreInt32(&p.capacity, int32(size))
|
atomic.StoreInt32(&p.capacity, int32(size))
|
||||||
diff := p.Running() - size
|
diff := p.Running() - size
|
||||||
if diff > 0 {
|
|
||||||
for i := 0; i < diff; i++ {
|
for i := 0; i < diff; i++ {
|
||||||
p.getWorker().task <- nil
|
p.getWorker().task <- nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release Closes this pool.
|
// Release Closes this pool.
|
||||||
|
|
|
@ -148,11 +148,9 @@ func (p *PoolWithFunc) ReSize(size int) {
|
||||||
}
|
}
|
||||||
atomic.StoreInt32(&p.capacity, int32(size))
|
atomic.StoreInt32(&p.capacity, int32(size))
|
||||||
diff := p.Running() - size
|
diff := p.Running() - size
|
||||||
if diff > 0 {
|
|
||||||
for i := 0; i < diff; i++ {
|
for i := 0; i < diff; i++ {
|
||||||
p.getWorker().args <- nil
|
p.getWorker().args <- nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release Closed this pool.
|
// Release Closed this pool.
|
||||||
|
|
Loading…
Reference in New Issue