limiting: Make SemaphoreLimiter.Acquire() zero-alloc #8
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ func (lr *SemaphoreLimiter) Acquire(key string) (ReleaseFunc, bool) {
|
|||
}
|
||||
|
||||
if ok := sem.Acquire(); ok {
|
||||
return func() { sem.Release() }, true
|
||||
return sem.Release, true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue