clean peerset constructor names

This commit is contained in:
Jeromy 2014-12-17 19:27:41 +00:00 committed by Juan Batiz-Benet
parent 8100582e38
commit 9328fbaf81
3 changed files with 4 additions and 4 deletions

View File

@ -212,7 +212,7 @@ func (bs *bitswap) sendWantlistToProviders(ctx context.Context, wantlist *wantli
message.AddEntry(e.Key, e.Priority)
}
ps := pset.NewPeerSet()
ps := pset.New()
// Get providers for all entries in wantlist (could take a while)
wg := sync.WaitGroup{}

View File

@ -141,7 +141,7 @@ func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key u.Key, count int
func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key u.Key, count int, peerOut chan peer.Peer) {
defer close(peerOut)
ps := pset.NewLimitedPeerSet(count)
ps := pset.NewLimited(count)
provs := dht.providers.GetProviders(ctx, key)
for _, p := range provs {
// NOTE: assuming that this list of peers is unique

View File

@ -12,14 +12,14 @@ type PeerSet struct {
size int
}
func NewPeerSet() *PeerSet {
func New() *PeerSet {
ps := new(PeerSet)
ps.ps = make(map[string]bool)
ps.size = -1
return ps
}
func NewLimitedPeerSet(size int) *PeerSet {
func NewLimited(size int) *PeerSet {
ps := new(PeerSet)
ps.ps = make(map[string]bool)
ps.size = size