clean peerset constructor names
Jeromy committed
Dec 17, 2014 at 19:27 UTC
9328fbaf8141f2ff31eda6feb38518ddeb79fe19
3 files changed
+4
-4
exchange/bitswap/bitswap.go
+1
-1
@@ -212,7 +212,7 @@ func (bs *bitswap) sendWantlistToProviders(ctx context.Context, wantlist *wantli
212
message.AddEntry(e.Key, e.Priority)
213
}
214
215
- ps := pset.NewPeerSet()
215
+ ps := pset.New()
216
217
// Get providers for all entries in wantlist (could take a while)
218
wg := sync.WaitGroup{}
routing/dht/routing.go
+1
-1
@@ -141,7 +141,7 @@ func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key u.Key, count int
141
func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key u.Key, count int, peerOut chan peer.Peer) {
142
defer close(peerOut)
143
144
- ps := pset.NewLimitedPeerSet(count)
144
+ ps := pset.NewLimited(count)
145
provs := dht.providers.GetProviders(ctx, key)
146
for _, p := range provs {
147
// NOTE: assuming that this list of peers is unique
util/peerset/peerset.go
+2
-2
@@ -12,14 +12,14 @@ type PeerSet struct {
12
size int
13
}
14
15
-func NewPeerSet() *PeerSet {
15
+func New() *PeerSet {
16
ps := new(PeerSet)
17
ps.ps = make(map[string]bool)
18
ps.size = -1
19
return ps
20
}
21
22
-func NewLimitedPeerSet(size int) *PeerSet {
22
+func NewLimited(size int) *PeerSet {
23
ps := new(PeerSet)
24
ps.ps = make(map[string]bool)
25
ps.size = size