Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: zhoudeyu <[email protected]>
  • Loading branch information
xiaoyuzdy and zhoudeyu authored Apr 1, 2021
1 parent 8584351 commit 4e0d91f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/hash/consistenthash.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (h *ConsistentHash) Remove(node interface{}) {
index := sort.Search(len(h.keys), func(i int) bool {
return h.keys[i] >= hash
})
if index < len(h.keys) {
if index < len(h.keys) && h.keys[index] == hash {
h.keys = append(h.keys[:index], h.keys[index+1:]...)
}
h.removeRingNode(hash, nodeRepr)
Expand Down

0 comments on commit 4e0d91f

Please sign in to comment.