refactor: simplify topology gossip gob decoder initialisation
Should be more efficient too due to less copying.
This commit is contained in:
1 parent
62bbaf57a2
commit
34e3f0ba3f
1 file changed
+1
-3
+1
-3
@@ -206,9 +206,7 @@ func (peers *Peers) decodeUpdate(update []byte) (newPeers map[PeerName]*Peer, de
|
||||
decodedUpdate = []*Peer{}
|
||||
decodedConns = [][]ConnectionSummary{}
|
||||
|
||||
updateBuf := new(bytes.Buffer)
|
||||
updateBuf.Write(update)
|
||||
decoder := gob.NewDecoder(updateBuf)
|
||||
decoder := gob.NewDecoder(bytes.NewReader(update))
|
||||
|
||||
for {
|
||||
peerSummary, connSummaries, decErr := decodePeer(decoder)
|
||||
|
||||
Reference in new issue
Block a user