func normalizeConsensus(consensus []mesh.PeerName) []mesh.PeerName {
	if len(consensus) == 0 {
		return nil
	}

	peers := make(peerNames, len(consensus))
	copy(peers, consensus)
	sort.Sort(peers)

	dst := 0
	for src := 1; src < len(peers); src++ {
		if peers[dst] != peers[src] {
			dst++
			peers[dst] = peers[src]
		}
	}

	return peers[:dst+1]
}
// When we get a consensus from Paxos, the peer names are not in a
// defined order and may contain duplicates.  This function sorts them
// and de-dupes.
When we get a consensus from Paxos, the peer names are not in a
defined order and may contain duplicates.  This function sorts them
and de-dupes.
// When we get a consensus from Paxos the peer names are not in a // defined order and may contain duplicates . This function sorts them // and de - dupes .
func normalizeConsensus(consensus []mesh.PeerName) []mesh.PeerName {
	if len(consensus) == 0 {
		return nil
	}
	peers := make(peerNames, len(consensus))
	copy(peers, consensus)
	sort.Sort(peers)
	dst := 0
	for src := 1; src < len(peers); src++ {
		if peers[dst] != peers[src] {
			dst++
			peers[dst] = peers[src]
		}
	}
	return peers[:dst+1]
}
func normalizeConsensus ( consensus [ ] mesh . PeerName ) [ ] mesh . PeerName { if len ( consensus ) == 0 { return nil } peers := make ( peerNames , len ( consensus ) ) copy ( peers , consensus ) sort . Sort ( peers ) dst := 0 for src := 1 ; src < len ( peers ) ; src ++ { if peers [ dst ] != peers [ src ] { dst ++ peers [ dst ] = peers [ src ] } } return peers [ : dst + 1 ] }
When we get a consensus from Paxos, the peer names are not in a
defined order and may contain duplicates.
When we get a consensus from Paxos the peer names are not in a defined order and may contain duplicates .