diff --git a/pool.go b/pool.go index 04730de..36fe5cb 100644 --- a/pool.go +++ b/pool.go @@ -146,10 +146,8 @@ func (p *Pool) ReSize(size int) { } atomic.StoreInt32(&p.capacity, int32(size)) diff := p.Running() - size - if diff > 0 { - for i := 0; i < diff; i++ { - p.getWorker().task <- nil - } + for i := 0; i < diff; i++ { + p.getWorker().task <- nil } } diff --git a/pool_func.go b/pool_func.go index 3423ab7..fbcbe9d 100644 --- a/pool_func.go +++ b/pool_func.go @@ -148,10 +148,8 @@ func (p *PoolWithFunc) ReSize(size int) { } atomic.StoreInt32(&p.capacity, int32(size)) diff := p.Running() - size - if diff > 0 { - for i := 0; i < diff; i++ { - p.getWorker().args <- nil - } + for i := 0; i < diff; i++ { + p.getWorker().args <- nil } }