Skip to content

Commit

Permalink
fix comment.
Browse files Browse the repository at this point in the history
Signed-off-by: imxyb <xyb4638@gmail.com>
  • Loading branch information
imxyb committed Nov 26, 2019
1 parent 7fb327e commit 7269258
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cluster/loadbalance/consistent_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import (
"sort"
"strconv"
"strings"
)

import (
"github.com/apache/dubbo-go/cluster"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/extension"
Expand All @@ -39,8 +41,10 @@ const (
HashArguments = "hash.arguments"
)

var selectors = make(map[string]*ConsistentHashSelector)
var re = regexp.MustCompile(constant.COMMA_SPLIT_PATTERN)
var (
selectors = make(map[string]*ConsistentHashSelector)
re = regexp.MustCompile(constant.COMMA_SPLIT_PATTERN)
)

func init() {
extension.SetLoadbalance(ConsistentHash, NewConsistentHash)
Expand Down Expand Up @@ -99,10 +103,6 @@ type ConsistentHashSelector struct {

func NewConsistentHashSelector(invokers []protocol.Invoker, methodName string,
hashCode uint32) *ConsistentHashSelector {
if len(invokers) == 0 {
panic("none of invokers")
}

selector := &ConsistentHashSelector{}
selector.virtualInvokers = make(map[uint32]protocol.Invoker)
selector.hashCode = hashCode
Expand Down

0 comments on commit 7269258

Please sign in to comment.