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

多个变量合并到var申明

parent 93dc5f5d
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 ...@@ -62,12 +62,14 @@ func (lb *roundRobinLoadBalance) Select(invokers []protocol.Invoker, invocation
cache, _ := methodWeightMap.LoadOrStore(key, &cachedInvokers{}) cache, _ := methodWeightMap.LoadOrStore(key, &cachedInvokers{})
cachedInvokers := cache.(*cachedInvokers) cachedInvokers := cache.(*cachedInvokers)
clean := false var (
totalWeight := int64(0) clean = false
maxCurrentWeight := int64(math.MinInt64) totalWeight = int64(0)
var selectedInvoker protocol.Invoker maxCurrentWeight = int64(math.MinInt64)
var selectedWeightRobin *weightedRoundRobin now = time.Now()
now := time.Now() selectedInvoker protocol.Invoker
selectedWeightRobin *weightedRoundRobin
)
for _, invoker := range invokers { for _, invoker := range invokers {
var weight = GetWeight(invoker, invocation) 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