diff --git a/netmap/node_info.go b/netmap/node_info.go index ee474f0..a0cef19 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -74,8 +74,8 @@ const ( AttrContinent = "Continent" ) -// GetBucketWeight computes weight for a Bucket. -func GetBucketWeight(ns nodes, a aggregator, wf weightFunc) float64 { +// calcBucketWeight computes weight for a Bucket. +func calcBucketWeight(ns nodes, a aggregator, wf weightFunc) float64 { for i := range ns { a.Add(wf(ns[i])) } diff --git a/netmap/selector.go b/netmap/selector.go index cfeecd2..b723d19 100644 --- a/netmap/selector.go +++ b/netmap/selector.go @@ -97,7 +97,7 @@ func (c *context) getSelection(p *PlacementPolicy, s *Selector) ([]nodes, error) if len(c.pivot) != 0 { weights := make([]float64, len(res)) for i := range res { - weights[i] = GetBucketWeight(res[i], c.aggregator(), c.weightFunc) + weights[i] = calcBucketWeight(res[i], c.aggregator(), c.weightFunc) } hrw.SortSliceByWeightValue(res, weights, c.pivotHash)