Skip to content

Commit

Permalink
Remove redundant casts (#2558)
Browse files Browse the repository at this point in the history
* Remove redundant type cast

This commit removes a redundant type cast in gossip/comm/comm_impl.go

Change-Id: Ie8b921a5097f0d05f6645e67c31940c9daec0eb5
Signed-off-by: Yacov Manevich <[email protected]>

* Remove redundant casts in discovery

This commit removes redundant casts in discovery/service.go

Change-Id: I6b52ba91ccbe0ffeb696943aafa12fa3e07012fd
Signed-off-by: Yacov Manevich <[email protected]>
  • Loading branch information
yacovm authored Apr 23, 2021
1 parent bd640c8 commit 12f9b40
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions discovery/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/discovery/protoext"
common2 "github.com/hyperledger/fabric/gossip/common"
discovery2 "github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/protoutil"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -181,7 +180,7 @@ func (s *Service) channelMembershipResponse(q *discovery.Query) *discovery.Query
return wrapError(err)
}
membersByOrgs := make(map[string]*discovery.Peers)
chanPeerByID := discovery2.Members(chanPeers).ByID()
chanPeerByID := chanPeers.ByID()
for org, ids2Peers := range s.computeMembership(q) {
membersByOrgs[org] = &discovery.Peers{}
for id, peer := range ids2Peers {
Expand Down Expand Up @@ -211,7 +210,7 @@ func (s *Service) localMembershipResponse(q *discovery.Query) *discovery.QueryRe

func (s *Service) computeMembership(_ *discovery.Query) map[string]peerMapping {
peersByOrg := make(map[string]peerMapping)
peerAliveInfo := discovery2.Members(s.Peers()).ByID()
peerAliveInfo := s.Peers().ByID()
for org, peerIdentities := range s.IdentityInfo().ByOrg() {
peersForCurrentOrg := make(peerMapping)
peersByOrg[org] = peersForCurrentOrg
Expand Down

0 comments on commit 12f9b40

Please sign in to comment.