refactor: simplify topology gossip gob decoder initialisation

Should be more efficient too due to less copying.
This commit is contained in:
Matthias Radestock committed 2015-06-05 07:39:34 +01:00
1 parent 62bbaf57a2
commit 34e3f0ba3f
1 file changed
+1 -3
+1 -3
View File
@@ -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)