Skip to content

Commit b6c113c

Browse files
authored
Merge pull request #516 from zenhack/delete-releasedClients
Promise: delete unnecessary releasedClients field
2 parents c434d9f + e1b39e5 commit b6c113c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

answer.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ type promiseState struct {
5858
// in the pending state.
5959
clients map[clientPath]*clientAndPromise
6060

61-
// releasedClients is true after ReleaseClients has been called on this
62-
// promise. Only the receiver of ReleaseClients should set this to true.
63-
releasedClients bool
64-
6561
// result and err are the values from Fulfill or Reject respectively
6662
// in the resolved state.
6763
result Ptr
@@ -222,10 +218,6 @@ func (p *Promise) Answer() *Answer {
222218
func (p *Promise) ReleaseClients() {
223219
<-p.resolved
224220
clients := mutex.With1(&p.state, func(p *promiseState) map[clientPath]*clientAndPromise {
225-
if p.releasedClients {
226-
return nil
227-
}
228-
p.releasedClients = true // must happen before traversing pointers
229221
clients := p.clients
230222
p.clients = nil
231223
return clients

0 commit comments

Comments
 (0)