Skip to content

Commit

Permalink
remove: sync.RWMutex
Browse files Browse the repository at this point in the history
  • Loading branch information
phantaic committed Nov 16, 2023
1 parent cf7daa1 commit 125c5c3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/discovery/discovery_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

cerr "github.com/cherry-game/cherry/error"
cslice "github.com/cherry-game/cherry/extend/slice"
cherryString "github.com/cherry-game/cherry/extend/string"
cfacade "github.com/cherry-game/cherry/facade"
clog "github.com/cherry-game/cherry/logger"
cproto "github.com/cherry-game/cherry/net/proto"
Expand Down Expand Up @@ -75,9 +74,9 @@ func (n *DiscoveryDefault) Map() map[string]cfacade.IMember {
memberMap := map[string]cfacade.IMember{}

n.memberMap.Range(func(key, value any) bool {
nodeId := cherryString.ToString(key)
member := value.(cfacade.IMember)
memberMap[nodeId] = member
if member, ok := value.(cfacade.IMember); ok {
memberMap[member.GetNodeId()] = member
}
return true
})

Expand Down

0 comments on commit 125c5c3

Please sign in to comment.