Skip to content
Snippets Groups Projects
Commit c648b81e authored by zonghaishang's avatar zonghaishang
Browse files

多个变量合并到var申明

parent 872fa6f4
No related branches found
No related tags found
No related merge requests found
......@@ -62,12 +62,14 @@ func (lb *roundRobinLoadBalance) Select(invokers []protocol.Invoker, invocation
cache, _ := methodWeightMap.LoadOrStore(key, &cachedInvokers{})
cachedInvokers := cache.(*cachedInvokers)
clean := false
totalWeight := int64(0)
maxCurrentWeight := int64(math.MinInt64)
var selectedInvoker protocol.Invoker
var selectedWeightRobin *weightedRoundRobin
now := time.Now()
var (
clean = false
totalWeight = int64(0)
maxCurrentWeight = int64(math.MinInt64)
now = time.Now()
selectedInvoker protocol.Invoker
selectedWeightRobin *weightedRoundRobin
)
for _, invoker := range invokers {
var weight = GetWeight(invoker, invocation)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment