refactor: make Peer.Connections() return a set instead of a slice
This is more flexible since it allows callers to perform efficient lookups on the result.
This commit is contained in:
1 parent
fe4d8b7767
commit
9b9d8a03aa
6 files changed
+16
-9
No files matched your search
+1
-1
@@ -133,7 +133,7 @@ func (peers *Peers) String() string {
|
||||
var buf bytes.Buffer
|
||||
peers.ForEach(func(peer *Peer) {
|
||||
fmt.Fprint(&buf, peer, "\n")
|
||||
for _, conn := range peer.Connections() {
|
||||
for conn := range peer.Connections() {
|
||||
established := ""
|
||||
if !conn.Established() {
|
||||
established = " (unestablished)"
|
||||
|
||||
Reference in new issue
Block a user