Skip to content

Commit

Permalink
Update sharedcalls.go (zeromicro#174)
Browse files Browse the repository at this point in the history
Removes unused parameters
  • Loading branch information
wuqinqiang authored Oct 31, 2020
1 parent 7f99a3b commit cc07a1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/syncx/sharedcalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewSharedCalls() SharedCalls {
}

func (g *sharedGroup) Do(key string, fn func() (interface{}, error)) (interface{}, error) {
c, done := g.createCall(key, fn)
c, done := g.createCall(key)
if done {
return c.val, c.err
}
Expand All @@ -43,7 +43,7 @@ func (g *sharedGroup) Do(key string, fn func() (interface{}, error)) (interface{
}

func (g *sharedGroup) DoEx(key string, fn func() (interface{}, error)) (val interface{}, fresh bool, err error) {
c, done := g.createCall(key, fn)
c, done := g.createCall(key)
if done {
return c.val, false, c.err
}
Expand All @@ -52,7 +52,7 @@ func (g *sharedGroup) DoEx(key string, fn func() (interface{}, error)) (val inte
return c.val, true, c.err
}

func (g *sharedGroup) createCall(key string, fn func() (interface{}, error)) (c *call, done bool) {
func (g *sharedGroup) createCall(key string) (c *call, done bool) {
g.lock.Lock()
if c, ok := g.calls[key]; ok {
g.lock.Unlock()
Expand Down

0 comments on commit cc07a1d

Please sign in to comment.